The Grid I Didn't Need
Building a 2D grid and recursive solver for a problem that needed simple addition.
Building a 2D grid and recursive solver for a problem that needed simple addition.
When slices technically work but maps (or Union-Find) are what you actually need.
Put boundary checks in the base case, not at call sites. Simplify the technique so you can focus on the puzzle.
When your recursive solution is exponentially slow because you forgot to cache.
When your data structures fight against the problem instead of representing it naturally.
Building elaborate data structures before understanding minimum required state.
Assuming uniformity, ignoring line-wrapping, and premature transformationâall from one puzzle.
Using genetic algorithms to solve exponential population growth - when Mother Nature helps with Advent of Code