2 ms·
No, it doesn't involve the "a-ha" moment. Two-pass solution is obvious, just look at the final state. Once you are at that, the one-pass is a run-of-the-mill o
by huhtenberg 13y ago
No, it doesn't involve the "a-ha" moment.
Two-pass solution is obvious, just look at the final state. Once you are at that, the one-pass is a run-of-the-mill optimization of switching from accumulating and then processing the state to doing it all in parallel. The ability to recognize when this is doable is a good way to tell someone who's done it before (in some other context) from those who merely wrote a functional prototype of Tic-Tac-Toe in TurboPascal.
- peterwiese 13y agohahaha, great answer.