Advent of Code 2024: Thoughts

Last December was the first time I seriously participated in AoC. I generally had a lot of fun solving the tasks, earning ⭐s, discussing solutions with my friend, and even peeking into r/adventofcode
a bit when I was stuck. Probably, the main thing AoC reminded me about was “be practical, Steve”.
If you want to get to the leaderboard, or don’t want to read about elves and Christmas trees in January and February, you have only one day to solve two tasks. AoC only wants you to give the answer, not the solution, so it doesn’t really matter if your solution is super optimal or nicely coded. All this hints that one should take a very practical approach: start with the most obvious and simple solution, and try to improve it only when it doesn’t work.
At the beginning, I was trying to be smart and avoided obvious solutions, thinking about the most optimal ones. Naturally, I often found myself going through the following scenario:
- think hard to come up with a complex solution
- spend a lot of effort implementing it
- get “That’s not the right answer” from AoC, debug your code, realize there are cases the solution doesn’t cover
- get upset
- implement brute force
- get a star from AoC
After a couple of such sessions, I started changing my approach. In the end, the scenario was like this:
- think of the most obvious solution
- implement it
- think a bit about possible optimizations
- if you don’t get a star at step 2, implement optimizations
And I am really thankful to AoC for reminding me about this! I think being practical is very important in software engineering — and very often in real life in general.