Advent of Code 2021
A friend introduced me to Advent of Code as a fun Christmas activity. That was true at first.
Advent of Code is an annual set of programming puzzles released each day from December 1 through December 25. Each day has two related problems, generally with a small story wrapped around them, and the goal is to write a program that produces the right answer from a provided input.
The early days felt approachable: parse some input, simulate a small system, count something, and move on. Then the difficulty began to scale up very quickly.
The format
Each puzzle has two parts.
The first part usually introduces the core idea. The second part takes that same idea and adds a larger input, an extra constraint, or a detail that makes the straightforward solution too slow or too simple.
That format is good at teaching a specific lesson:
- A solution can be correct but too slow.
- Input parsing is often part of the challenge.
- Choosing the right data structure matters.
- A problem that looks like simulation may need graph traversal, recursion, dynamic programming, or a completely different representation.
By the later problems, I was spending much more time figuring out how to think about the problem.
When the difficulty changed
There was a point where solving a puzzle independently stopped being the default.
For some of the later days, I turned to the Advent of Code subreddit to read explanations, compare approaches, and understand the underlying techniques. That was not quite the same as solving everything from scratch, but it was still useful. Seeing how other people reduced a problem, recognized a known algorithm, or found the important constraint was often the lesson I was missing.
I kept my solutions in a GitHub repository: link
I would not describe the code as polished. Most of it was written as one-time, throwaway puzzle code: enough structure to get an answer, but not necessarily the kind of thing I would want to maintain, document, or use as an example of production-quality design.
That is fine. The point was not to build a reusable library. The point was to practice.
Was it worth it?
Advent of Code can be a real grind, especially if you try to keep up with every day. It rewards persistence more than elegance, and the later puzzles can be humbling.