UP HOME

Week 2 of AOC 2025

[2025-12-14 Sun]

Problem solving is fun and satisfying, but it can be frustrating and time-consuming as well. I'm writing this while struggling to solve Part 2 of Day 9; it left a lingering aftertaste of frustration, and I decided to call it a day and start writing this post until I come back with some fresh ideas.

Nevertheless, I'm happy with this week's work: very fun problems, some easier than others, but I had a good time solving every one of them.

The following is a brief debrief of each day’s problem.

Advent Of Code Week 2 Progress

Day 3 - maximum number with digit placement constraints

Source Code : Part 1 Part 2

This was fun. Part 2 required a recursive solution, which is always enjoyable to code. I had to cache the results because of the algorithm's complexity. The problem is: given a string of digits (e.g. 24321532135234324), which 12 digits should be picked to form the maximum possible number while preserving the original order of the digits?

Day 4 - Removing paper rolls

Source Code : Part 1 Part 2

Given a grid containing either paper rolls or blanks, a paper roll can be removed if it has fewer than 3 neighbors. How many paper rolls can be removed if we repeatedly delete all removable rolls until no more can be deleted? This was a pretty straightforward problem and not too difficult to solve.

Day 5 - Compressing intervals

Source Code : Part 1 Part 2

Probably the easiest Part 1 so far. It mostly consisted of parsing the input correctly and then checking whether each ingredient ID falls within one of the given valid intervals. For Part 2, the solution consisted of sorting the intervals and then compressing them to count how many unique IDs they contain, since the intervals can overlap.

Day 6 - Calculation while respecting padding

Source Code : Part 1 Part 2

A nice problem that involved some matrix transposition and string manipulation. I really enjoyed Part 2 and definitely recommend solving this one.

Day 7 - Taychon beam splitting

Source Code : Part 1 Part 2

Another recursive solution. A very nice problem of splitting a taychon beam: how many times will it split, and how many different timelines are possible? A timeline is defined as a distinct taychon beam-splitting configuration.

Day 8 - Connecting junction boxes

Source Code : Part 1 Part 2

This one wasn't too hard. It mainly required creating a few extra data structures (nothing fancy, just some sorted lists of structs), and voilà.

Day 9 - Red and Green Walls

Source Code : Part 1 Part 2 (failed attempts)

Part 1 was super easy. For Part 2, I gave up after about two hours and two failed attempts. The solution worked nicely on the sample input and smaller cases, but the Advent of Code input was too large for my approach. I'll try again another day with a better solution.


Thanks for reading!

Subscribe to get future posts via email


Add a comment


Comments (0)


Copyright © 2025 Abderrahmane Faiz

learn_in_public@afaiz.dev