Add 2024 Day 18

This commit is contained in:
Burnus 2024-12-18 18:41:09 +01:00
parent 6d51162683
commit 0d2250e703

View file

@ -69,6 +69,49 @@ OO.#OOO
Simulate the first kilobyte (`1024` bytes) falling onto your memory space. Afterward, *what is the minimum number of steps needed to reach the exit?* Simulate the first kilobyte (`1024` bytes) falling onto your memory space. Afterward, *what is the minimum number of steps needed to reach the exit?*
To begin, [get your puzzle input](18/input). Your puzzle answer was `302`.
Answer: \--- Part Two ---
----------
The Historians aren't as used to moving around in this pixelated universe as you are. You're afraid they're not going to be fast enough to make it to the exit before the path is completely blocked.
To determine how fast everyone needs to go, you need to determine *the first byte that will cut off the path to the exit*.
In the above example, after the byte at `1,1` falls, there is still a path to the exit:
```
O..#OOO
O##OO#O
O#OO#OO
OOO#OO#
###OO##
.##O###
#.#OOOO
```
However, after adding the very next byte (at `6,1`), there is no longer a path to the exit:
```
...#...
.##..##
.#..#..
...#..#
###..##
.##.###
#.#....
```
So, in this example, the coordinates of the first byte that prevents the exit from being reachable are `*6,1*`.
Simulate more of the bytes that are about to corrupt your memory space. *What are the coordinates of the first byte that will prevent the exit from being reachable from your starting position?* (Provide the answer as two integers separated by a comma with no other characters.)
Your puzzle answer was `24,32`.
Both parts of this puzzle are complete! They provide two gold stars: \*\*
At this point, you should [return to your Advent calendar](/2024) and try another puzzle.
If you still want to see it, you can [get your puzzle input](18/input).