/images/avatar_square.jpg

Advent of Code 2025 - Day 8: Playground

Day 8 was brutal. Not because the algorithm is complex - but because I kept making implementation mistakes that cost hours of debugging.

The Problem

Given 3D coordinates of junction boxes, connect them with light strings. Connect the closest pairs first, forming circuits. After making a certain number of connections, find the sizes of the three largest circuits.

This is essentially asking: perform a greedy connection strategy (always connect the two closest unconnected boxes) and track which connected components (circuits) form.

Advent of Code 2025 - Day 7: Laboratories

Day 7 was about tachyon beams splitting through a manifold. Part 1 was a straightforward recursive beam tracer. Part 2 took a completely different approach with a quantum twist.

Part 1: Classical Beam Splitting

A tachyon beam enters at S and travels downward. When it hits a splitter (^), it stops and creates two new beams going down-left and down-right.

Example:

1
2
3
4
5
.......S.......
.......|.......
......|^|......
......|.|......
.....|^|^|.....

Count how many times the beam splits.

Advent of Code 2025 - Day 6: Trash Compactor

Day 6 was a breath of fresh air after the complexity of Days 3-5. The problem involved parsing a math worksheet where problems are arranged vertically in columns. Both parts were straightforward grid manipulation.

Part 1: Vertical Math Problems

The worksheet has numbers stacked vertically with operators at the bottom. Each column is a separate problem, and we need to sum all the answers.

Example:

1
2
3
4
123 328  51 64 
 45 64  387 23 
  6 98  215 314
*   +   *   +  

This represents four problems:

Advent of Code 2025 - Day 5: Cafeteria

Day 5 was about checking ingredient freshness using ID ranges. Part 1 was straightforward with a range check. Part 2 required merging overlapping ranges - something I knew how to do conceptually but struggled to implement correctly.

Part 1: Check Individual IDs

Given a list of fresh ingredient ID ranges and a list of ingredient IDs to check, count how many IDs fall within any range.

The Brute Force Trap

My first instinct was to build a complete set of all fresh IDs:

Advent of Code 2025 - Day 4: Printing Department

Day 4 brought us back to grid problems. The task involved identifying paper rolls on a grid that forklifts could access, where accessibility is determined by how many neighboring rolls surround each position.

Part 1: Finding Accessible Rolls

Grids are back, and so is my helper library fred.py. The problem is straightforward: count how many paper rolls (@) have fewer than 4 neighboring rolls in the 8 adjacent positions (including diagonals).

Advent of Code 2025 - Day 3: Lobby

Day 3 was about powering an escalator using batteries. Each battery bank is a string of digits, and the goal is to select specific digits to form the largest possible number. Part 1 was straightforward. Part 2… took some work.

Part 1: Two Batteries

The task: from each string of digits, pick exactly two to form the largest possible two-digit number. For example, from 811111111111119, you’d pick the 8 and 9 to get 89.