Right Tool for the Job
When slices technically work but maps (or Union-Find) are what you actually need.
AoC:25:08:1Godata-structuresUnion-Find
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