Advent of Code Day 1
- 2 minutes read - 291 wordsSo I’m doing Advent of Code again this year. I am of course not a professional coder, so my solutions tend to be basic but functional.
For me, it’s much more about what I can learn than any kind of sensible competition with colleagues and friends. However, I do abide by the friendly rules in vogue at my employer. That means no discussion of the solution for day 1 until day 2, and so on. (That also means that I won’t push my solutions to the repo until the day after.)
I do want to say though that it’s always a major learning experience for me —
I generally learn one or more new language features each year. This time, it’s
the collections library, and in particular Counter. I don’t want to give too
much away, but I do feel I’m definitely improving as a Pythonista. For instance,
part one of the puzzle asks for the top three items, and there’s a delightful
way to do that with Counter. Then part two asks for the bottom three — and
that works in a suitably Pythonic and delightful way. I think this was the first
time that part two has taken me only a few seconds.
Amped for day 2. I normally only get to about day 6, so I’m curious as to what’ll happen this year.
If you’re not familiar with Advent of Code, but fancy having a go at 12 code challenges, I suggest checking it out. Previous years’ challenges are archived there also, so there’s plenty to have at. (As for why there’s 12 challenges, not the 24 you’d expect, this is explained on the site, but TL;DR — people competing for the global leaderboard ruining it for everyone.)