Source: Day 10: Hoof It
Full solution for today (spoilers!).
Part 1
Given a heightmap (
0
to9
), for each0
count how many9
you can reach on paths that only ever increase height by exactly 1 at a time. Sum these values.
Full solution for today (spoilers!).
Given a heightmap (
0
to9
), for each0
count how many9
you can reach on paths that only ever increase height by exactly 1 at a time. Sum these values.
Full solution for today (spoilers!).
Given a disk layout alternating between files and empty spaces, move all files as early on the disk is possible, splitting into multiple blocks. Return a checksum on the disk.
Alternating means:
23331
would mean a 2 block file, 3 empty, a 3 block file, 3 empty, and a 1 block file.The checksum is the sum of
file_id * block_index
for all occupied blocks. File IDs are assigned sequentially on initial generation.
Full solution for today (spoilers!).
Given a grid with either open tiles (
.
) or towers (anything else), for each pair of towers, there is an antinode at each of the points that is 2x as far from one tower as the other. How many antinodes are there still within the bounds of the map?
Full solution for today (spoilers!).
You are given a grid of walls (
#
), floors (.
), and a guard (^
, initially facing up/north). The guard walks forward until they run into a wall at which point they turn right. How many tiles does the guard reach before leaving the map.
Given a map with a series of moving walls (that wrap when the hit the edges of the simulation), calculate the fastest route from the top left to the bottom right.
Implement a cellular automaton with the following rules:
NSWE
, SWEN
, WENS
, ENSW
, NSWE
, …)Given a map and a series of instructions formatted as distance + turn (
L
orR
), find the final position. Any time you would walk off the edge of the map, wrap to the opposite edge.
Given a series of equations of either the form
dbpl: 5
orcczh: sllz + lgvd
, determine what the value of the node labeledroot
is.
Given a series of walls as input, run a falling sand simulation until any new sand falls of the map. Count how many grains of sand we end up with.
Given a grid of numbers, count how many of these numbers have a direct path in any cardinal direction to the edge of the grid.