AoC# 2024 - Day 2: Red-Nosed Reports

1 minute read

It’s Advent of Code time 🎄

Advent of Code is an Advent calendar of small programming puzzles for a variety of skill levels that can be solved in any programming language you like.

Day 2 started out pretty well then went spectacularly awry. Lack of sleep from being late to bed and an early start really hampered my comprehension of Part 2, so I’ve sped-up and chopped out a lot out of today’s video:

Part 1 ⭐️

Not too taxing a start, but I was still half asleep at 5am UK time when I began.

Part 2 ⭐️

What seemed like a simple tweak to Part 1 took me ages to get the correct answer. I was convinced I’d missed some edge case, so I took breaks to give myself time to figure out out what I could be missing or what an elegant solution would look like.

Then, after 3 hours or so I was tired and just wanted the answer.

I had briefly considered a brute force approach so after yet another hour or so of trying in vain, I checked the Reddit thread for a hint or pointer and saw Josiah Winslow’s blog post where it seems his experience was as similarly frustrating as mine, eventually solving it with brute force.

So that’s what I did too - I doubted the result initially so I hesitated submitting it, but it worked!

Updated: