Source: Day 18: Lavaduct Lagoon
Full solution for today (spoilers!)
Part 1
Given a sequence of direction + distance that draws a polygon, calculate the area.
Full solution for today (spoilers!)
Given a sequence of direction + distance that draws a polygon, calculate the area.
Full solution for today (spoilers!)
Given a grid of costs, find the shortest path from top left to bottom right. You may not double back or go straight more than 3 steps in a row.
Full solution for today (spoilers!)
You are given a grid of mirrors (
|-\/
) and empty space (.
).Diagonal mirrors just relect the light.
The horizontal and vertical mirrors are splitters, light hitting them head on (like
>|
) will split to go both directions. Light hitting edge on will just go through it.Starting in the top left going East, how many total tiles will a light beam illuminate?
Full solution for today (spoilers!)
Hash each input (comma separated) with
h(v, c) = (v + c) * 17
(modulo 256 / as a byte). Sum these values.
Full solution for today (spoilers!)
Given a grid of
#
andO
(among empty.
points) whereO
can move, slide eachO
as far north as it can. Score each based on how far north it is.
Full solution for today (spoilers!)
You are given a grid of
.
and#
. Find the (single) axis of reflection (between two rows or columns).
Full solution for today (spoilers!)
Given a sequence of
#.?
as on, off, and unknown and a sequence of group sizes, determine how many possible arrangements there are that match the given groups.More specifically, if you have
???.## 1,2
you need a single#
and a set of two##
, there are three possibilities:#...###
,.#..###
, and..#.###
.
Full solution for today (spoilers!)
Read a grid of
#
(stars) and.
(empty space). For each completely empty line or row, add another. Calculate the sum of the Manhattan distances between all pairs of stars.
Full solution for today (spoilers!)
You are given as input an ASCII art pipe diagram with straight pipes
|-
, right angle turnsLJ7F
, ground.
, and a start tileS
.The start tile will be part of a loop of pipes.
Find the distance to the furthest connected pipe segment from
S
(or half the length of the loop).
Full solution for today (spoilers!)
Given a list of terms, repeatedly calculate the differences of terms until these differences are 0. So:
0 3 6 9 12 15 3 3 3 3 3 0 0 0 0
Calculate the sum of next terms for each sequence (18 for this one).