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!).
Given a result and a list of numbers, determine if any combination of addition (
+
) and/or multiplication (*
) using all the given numbers in order can return the result. Ignore order of operations.
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.
Full solution for today (spoilers!).
The input is a list of pairs of the form
a|b
which defines thatb
must not come beforea
, an empty line, and then a list of valuesa,b,c,d
.For each line that is valid for all given
a|b
rules, sum the middle number of each list.
Full solution for today (spoilers!).
Given a grid of letters, count how many times
XMAS
appears in any direction (horizontally, vertically, diagonally; forward or backward).
Full solution for today (spoilers!).
Given a string containing (among other gibberish) commands of the form
mul({A}, {B})
where{A}
and{B}
are integers, calculate the sum ofA*B
s.
Full solution for today (spoilers!).
Count how many given lists of numbers are
safe
:
- Sorted (either ascending or descending)
- Strictly increasing/decreasing (no duplicate values)
- No increase/decrease is by more than 3
Full solution for today (spoilers!).
Given two lists of numbers arranged in columns in a file, find the sum of differences (in sorted order).