Advent of Code Day 2
So back to Advent of Code. And yay, Day 2 went swimmingly as well.
The first part looked hard, but then I realised that I’d made the usual “make it look harder than it is” mistake. You don’t need to compose the whole list, just keep track of how far you’ve got each time. This was pretty straightforward with some counting of offsets. Part 1 done.
I’ve often found that Part 2 of a day’s challenge is a tweak to Part 1. For Day 1,
I built a Counter object and then used it to identify the most common entry:
Advent of Code Day 1
So 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.)