Personal repository for my solution for this year.
I decided to use node for today and rattled through a naive solution that got me the answer as quick as I could. Couple of gotchas on the way with converting js strings to numbers.
Then when done I decided to solve with a reduce instead and looked up how to to that, learning two things.
- Truly understanding reduce by using it in anger
- The existance of javascript's unary plus
- How to use the spread operator
Over the past years of AoC I've noticed that many early puzzles are opportunities for junior devs to learn about modulos, today's was not different! I really should have realised I could use a modulo in part 1 instead of my clumsy conditional.
Looking forward to Day 2 now.