Source: Day 5: Cafeteria
Full solution for today (spoilers!).
Part 1
Given a list of ranges (inclusive) and a list of IDs, how many of the IDs are in any range?
Full solution for today (spoilers!).
Given a list of ranges (inclusive) and a list of IDs, how many of the IDs are in any range?
Full solution for today (spoilers!).
Given a grid of solid
@and empty cells., count how many solid cells have less than 4 neighbors.
Full solution for today (spoilers!).
Given a list of numbers, for each find the two digits in the number which if concatenated make the largest. Sum these values.
For example:
811111111111119should be89.
Full solution for today (spoilers!).
Given a list of ranges
a-b(ie11-22), sum all values that are made of two repeated chunks of digits (ie123123)
Full solution for today (spoilers!).
Implement a padlock with 100 values (0-99). Run each command (
L23to turn left by 23 places) and then output the number of times you landed on zero.
Full solution for today (spoilers!).
Given a sequence of values
v_n, replace each value with the first matching rule:
if v = 0 -> 1- If
vhas an even number of digits, split it (sov = 8675becomes[86, 75])- Otherwise,
v -> v * 2024Calculate how many elements are in the sequence after 25 iterations.
Full solution for today (spoilers!).
Given a heightmap (
0to9), for each0count how many9you 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:
23331would 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_indexfor 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.