Advent of Code - Day 9: Disk Fragmenter

2024-12-09-generated.png

Another push of the button leaves you in the familiar hallways of some friendly amphipods! Good thing you each somehow got your own personal mini submarine. The Historians jet away in search of the Chief, mostly by driving directly into walls.

-- [Day 9 - Advent of Code 2024[(https://adventofcode.com/2024/day/9)

Solution in Java

Full source can be found: in GitHub

Since todays challenge talks about disk usage with two potential states, one containing files (the FileSegment) the other being empty (the Spacing), I decided to model that out first.

[Read More]

Advent of Code - Day 8: Resonant Collinearity

2024-12-08-generated.png

You find yourselves on the roof of a top-secret Easter Bunny installation.

While The Historians do their thing, you take a look at the familiar huge antenna. Much to your surprise, it seems to have been reconfigured to emit a signal that makes people 0.1% more likely to buy Easter Bunny brand Imitation Mediocre Chocolate as a Christmas gift! Unthinkable!

-- Day 8 - Advent of Code 2024

Solution in Java

Full source can be found: in GitHub

[Read More]

Advent of Code - Day 7: Bridge Repair

Day 7 assignment

2024-12-07-generated.png

The Historians take you to a familiar rope bridge over a river in the middle of a jungle. The Chief isn’t on this side of the bridge, though; maybe he’s on the other side?

-- Day 7 - Advent of Code 2024

Solution in Java

Full source can be found: in GitHub

For today I setup a small little interface Instruction to capture the instructions that we can apply on the input numbers. As well as already adding the LiteralValue implementation of this interface to capture numbers. This would help to compute the possible answers in the two parts of today.

[Read More]

Advent of Code: Guard Gallivant

Day 6 assignment

2024-12-06-generated.png

The Historians use their fancy device again, this time to whisk you all away to the North Pole prototype suit manufacturing lab… in the year 1518! It turns out that having direct access to history is very convenient for a group of historians.

You still have to be careful of time paradoxes, and so it will be important to avoid anyone from 1518 while The Historians search for the Chief. Unfortunately, a single guard is patrolling this part of the lab.

[Read More]

Advent of Code: Print Queue

Day 5 assignment

2024-12-05-generated.png

Satisfied with their search on Ceres, the squadron of scholars suggests subsequently scanning the stationery stacks of sub-basement 17.

The North Pole printing department is busier than ever this close to Christmas, and while The Historians continue their search of this historically significant facility, an Elf operating a very familiar printer beckons you over.

-- Day 5 - Advent of Code 2024

Solution in Java

Full source can be found: in GitHub

[Read More]

Advent of Code: Ceres Search

Day 4 assignment

2024-12-04-generated.png

“Looks like the Chief’s not here. Next!” One of The Historians pulls out a device and pushes the only button on it. After a brief flash, you recognize the interior of the Ceres monitoring station!

-- Day 3 - Advent of Code 2024

Solution in Java

Full source can be found: in GitHub

Part 1

For the first part of today I chose to re-use my CharGrid class. With this I can iterate of all of the columns and rows looking for the X in any spot.

[Read More]

Advent of Code: Mull it over

Day 3 assignment

2024-12-03-generated.png

“Our computers are having issues, so I have no idea if we have any Chief Historians in stock! You’re welcome to check the warehouse, though,” says the mildly flustered shopkeeper at the North Pole Toboggan Rental Shop. The Historians head out to take a look.

Day 3 - Advent of Code 2024

Solution in Java

Full source can be found: in GitHub

Part 1

For part 1 I decided to use a regular expression (line 4) to extract all the mul(x,y) instructions of the input. For each match we find the result is converted to a number using a multiplication (line 7). Finally all the results are reduced using the sum() operation.

[Read More]

Advent of Code: Red-Nosed Reports

Day 2 assignment

2024-12-02-generated.png

Fortunately, the first location The Historians want to search isn’t a long walk from the Chief Historian’s office.

While the Red-Nosed Reindeer nuclear fusion/fission plant appears to contain no sign of the Chief Historian, the engineers there run up to you as soon as they see you. Apparently, they still talk about the time Rudolph was saved through molecular synthesis from a single electron.

-- Day 2 - Advent of Code 2024

[Read More]

Advent of Code: Historian Hysteria

Day 1 assignment

2024-12-01-generated.png

The Chief Historian is always present for the big Christmas sleigh launch, but nobody has seen him in months! Last anyone heard, he was visiting locations that are historically significant to the North Pole; a group of Senior Historians has asked you to accompany them as they check the places they think he was most likely to visit….

-- Day 1 - Advent of Code 2024

[Read More]

Advent of Code - Day 6: Wait For It

2023-12-06-generated.png

As you try to figure out what to do next, you notice a poster on a wall near the ferry dock. “Boat races! Open to the public! Grand prize is an all-expenses-paid trip to Desert Island!” That must be where the sand comes from! Best of all, the boat races are starting in just a few minutes.

-- Day 6 - Advent of Code 2023

Solution in Java

Full source can be found: in GitHub

[Read More]