Advent of Code 2024

Alex

Alex

Dec 26, 2024

Advent of Code is an absolute festive treat, created by Eric Wastl, providing daily coding problems throughout the lead-up to Christmas.

I came across it in 2017, and have engaged in the years since at varying degrees, irritating my friends on Instagram by posting daily about each challenge!

This year, 2024, is the 10-year anniversary of the project, and also the first year that I have completed all 49* problems, and received all 50 stars, so I have compiled all of my 2024 Instagram stories into 1 blog post.

I've marked my favourites with a little star ⭐️, and add some additional notes and context where I saw fit.

Sadly when I exported my stories from Instagram they removed the songs I put on them, which is fine for a blog format really, but it has left little the little album images on the screenshot so just FYI that's why they're there!

Day 0

Day 1: Historian Hysteria Problem Solution

Day 2: Red-Nosed Reports Problem Solution

⭐️ Day 3: Mull It Over Problem Solution

Pleased my memory of my undergrad compilers module is strong enough to still hand-roll a really simple parser.

It's a little overly complex, wasting recursion depth looking for non-branching chains of characters in separate functions (e.g. separate functions "n", "'", "t", as opposed to just chunking "n't").

Day 4: Ceres Search Problem Solution

Day 5: Print Queue Problem Solution

Day 6: Guard Gallivant Problem Solution

I resisted the urge to use Python's gorgeous networkx library here, but this was the first opportunity of many this year, and it made my graph manipulation a breeze in later problems.

Day 7: Bridge Repair Problem Solution

Day 8: Resonant Collinearity Problem Solution

Day 9: Disk Fragmenter Problem Solution

I really love being pushed to try implementing something I know exists and vaguely understand (like disk defragmentation), but haven't ever fully dug into, lovely learning opportunity!

Day 10: Hoof It Problem Solution

⭐️ Day 11: Plutonian Pebbles Problem Solution

Not sure if this is quite dynamic programming, but its definitely using memoisation which is an invaluable technique for these type of exercises, one I've been exposed to and experimented with gradually over the years of AoC, and I was pleased how quickly my solution came together for this problem.

Day 12: Garden Groups Problem Solution

Day 13: Claw Contraption Problem Solution

⭐️ Day 14: Restroom Redoubt Problem Solution

Part 2 was such a unique and interesting problem! I solved it very simply, visually inspecting thousands of images until I spotted the Christmas tree, but there were some genius solutions on the subreddit including someone who found the entropy of the drones positions, using the size of the compressed images, and the most compressable image had the tree!

Day 15: Warehouse Woes Problem Solution

Day 16: Reindeer Maze Problem Solution

⭐️ Day 17: Chronospatial Computer Problem Solution

This is where problems started taking a very long time this year. It took me at least 4 hours, the only problem where I ended up using Rust to try to achieve some speed gains, only to eventually solve it practically by hand by just thinking more carefully about the problem.

Day 18: RAM Run Problem Solution

Day 19: Linen Layout Problem Solution

Day 20: Race Condition Problem Solution

Day 21: Keypad Conundrum Problem Solution

This was the problem that took me the longest by far, 3 days and probably over 12 cumulative hours. I actually ended up using some hints from the Reddit (the only problem that I did this for). In the end it was a satisfying win because of the time I sunk into it, but not a ⭐️ favourite problem.

Day 22: Monkey Market Problem Solution

⭐️ Day 23: LAN Party Problem Solution

Similar to Day 9, this was an interesting opportunity to play with a well-known computer science problem.

Unfortunately, despite what I implied in the story below, I didn't revolutionise computer science, the size of the input was just small enough that my O(n!)(?) code still ran in reasonable time!

⭐️ Day 24: Crossed Wires Problem Solution

Such a cool problem; maybe my favourite. I feel like I basically followed the exact process I would if I were debugging a physical 45-bit adder circuit.

I also think it really lent itself to giving non-coders quite a deep insight into the problem. Explaining lines of code can only go so far, but being able to show people the visualisation I used, and hopefully understand exactly how I found the dodgy wires, felt really satisfying.

The software I used here, and in lots of the graph manipulation problems, to visualise graphs is called GraphViz and it's fantastically useful. Lots of things will output their graph representations in GraphViz (AKA dot), including the Python graph manipulation library networkx. And this handy website visualises the graphs for you online without having to setup any software.

Day 25: Code Chronicle Problem Solution

There was no part 2 for this problem, it just said I'd got enough stars to "Deliver The Chronicle", took me to the end of the story (below), and gave me the 50th for free!