Reflowed problems and added solutions

This commit is contained in:
2018-03-15 11:24:23 -05:00
parent 986d17f104
commit 2a37946673
50 changed files with 2124 additions and 1464 deletions

View File

@@ -2,32 +2,35 @@ Advent of Code
--- Day 3: Squares With Three Sides ---
Now that you can think clearly, you move deeper into the labyrinth of hallways and office
furniture that makes up this part of Easter Bunny HQ. This must be a graphic design
department; the walls are covered in specifications for triangles.
Now that you can think clearly, you move deeper into the labyrinth of
hallways and office furniture that makes up this part of Easter Bunny HQ.
This must be a graphic design department; the walls are covered in
specifications for triangles.
Or are they?
The design document gives the side lengths of each triangle it describes, but... 5 10 25? Some
of these aren't triangles. You can't help but mark the impossible ones.
The design document gives the side lengths of each triangle it describes,
but... 5 10 25? Some of these aren't triangles. You can't help but mark the
impossible ones.
In a valid triangle, the sum of any two sides must be larger than the remaining side. For
example, the "triangle" given above is impossible, because 5 + 10 is not larger than 25.
In a valid triangle, the sum of any two sides must be larger than the
remaining side. For example, the "triangle" given above is impossible,
because 5 + 10 is not larger than 25.
In your puzzle input, how many of the listed triangles are possible?
Your puzzle answer was ___.
Your puzzle answer was 869.
The first half of this puzzle is complete! It provides one gold star: *
--- Part Two ---
Now that you've helpfully marked up their design documents, it occurs to you that triangles
are specified in groups of three vertically. Each set of three numbers in a column specifies a
triangle. Rows are unrelated.
Now that you've helpfully marked up their design documents, it occurs to you
that triangles are specified in groups of three vertically. Each set of
three numbers in a column specifies a triangle. Rows are unrelated.
For example, given the following specification, numbers with the same hundreds digit would be
part of the same triangle:
For example, given the following specification, numbers with the same
hundreds digit would be part of the same triangle:
101 301 501
102 302 502
@@ -36,10 +39,10 @@ Advent of Code
202 402 602
203 403 603
In your puzzle input, and instead reading by columns, how many of the listed triangles are
possible?
In your puzzle input, and instead reading by columns, how many of the listed
triangles are possible?
Although it hasn't changed, you can still get your puzzle input.
Your puzzle answer was 1544
References