December 2023
Intermediate to advanced
504 pages
11h 43m
English
One of the most helpful strategies for both code optimization and algorithm development in general is to find patterns within the problem at hand. Often, the discovery of a pattern can help you cut through all the complexity of a problem and develop an algorithm that is simple.
Here’s a great example. A game I call “the coin game” has two players who compete in the following way: they start with a pile of coins, and each player has the choice of removing either one or two coins from the pile. The player who removes the last coin loses. Fun, right?
It turns out that this isn’t a game of random chance, and with the right strategy, you can force your opponent to take the last coin and lose the game. To make this ...
Read now
Unlock full access