Advent of Code - Day 14: Restroom Redoubt

2024-12-14-generated.png

One of The Historians needs to use the bathroom; fortunately, you know there’s a bathroom near an unvisited location on their list, and so you’re all quickly teleported directly to the lobby of Easter Bunny Headquarters.

-- Day 14 - Advent of Code 2024

Solution in Java

Full source can be found: in GitHub

Since the input is a robot I already added the following code before even starting any of the solution algorithms.

[Read More]

Advent of Code - Day 13: Claw Contraption

2024-12-13-generated.png

Next up: the lobby of a resort on a tropical island. The Historians take a moment to admire the hexagonal floor tiles before spreading out.

Fortunately, it looks like the resort has a new arcade! Maybe you can win some prizes from the claw machines?

-- Day 13 - Advent of Code 2024

Solution in Java

Full source can be found: in GitHub

First I created some records to represent the various entities in the assignment. This consists out of the PlayCost representing the amount of steps that each hit of the button will cost. The second record WinPoint represents the exact location that has to be hit to win a game.

[Read More]

Advent of Code - Day 12: Garden Groups

2024-12-12-generated.png

You’re about to settle near a complex arrangement of garden plots when some Elves ask if you can lend a hand. They’d like to set up fences around each region of garden plots, but they can’t figure out how much fence they need to order or how much it will cost. They hand you a map (your puzzle input) of the garden plots.

-- Day 12 - Advent of Code 2024

[Read More]

Advent of Code - Day 11: Plutonian Pebbles

2024-12-11-generated.png

The ancient civilization on Pluto was known for its ability to manipulate spacetime, and while The Historians explore their infinite corridors, you’ve noticed a strange set of physics-defying stones.

-- Day 11 - Advent of Code 2024

Solution in Java

Full source can be found: in GitHub

Part 1

For today the first step is writing a recursive method that computes the amount of blinks per stone in the input. This method stonesAfterBlink accepts the amount of blinks remaining, which is 25 for part 1. And uses a map as a cache, to prevent recalculation of any situation with the same amount of blinks left and for the same stone.

[Read More]

Advent of Code - Day 10: Hoof it

2024-12-10-generated.png

You all arrive at a Lava Production Facility on a floating island in the sky. As the others begin to search the massive industrial complex, you feel a small nose boop your leg and look down to discover a reindeer wearing a hard hat.

-- Day 10 - Advent of Code 2024

Solution in Java

Full source can be found: in GitHub

Part 1

The first step of today is to write a path finding algorithm based on Dijkstra. This will look for any path where each step size would be exactly 1 (line 12). And if the number 9 is found then the amount of found paths is increased.

[Read More]

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]