For Advent of Code 2023 Day 21, I'm given a grid of spaces and rocks, and asked to find how many spaces an elf could stop in after exactly 64 steps. I'll solve this with a queue and a breadth first fill. In part two, the number of steps changes to 26,501,365, which means I can't walk it anymore, but rather have to think about the diffent kinds of grids that might be encountered, how many possible stopping points there are, and how many of each type.
Code 2023 AOC: https://gitlab.com/0xdf/aoc2023
Challenge Link: https://adventofcode.com/2023/day/121
☕ Buy Me A Coffee: https://www.buymeacoffee.com/0xdf
[00:00] Part 1 description
[01:15] genday / input analysis
[02:04] Format grid, find start
[03:58] All steps via queue
[09:12] Debugging, fix mistake
[09:50] Solve part 1
[10:11] Part 2 description
[11:06] Refactor part 1 into function
[12:35] Input analysis again
[14:20] Complete grid analysis
[16:43] Introducing toy example
[19:06] Counting corners
[21:34] Counting interior
[24:16] Outer edges
[28:54] Inner edges
[30:38] Solve part 2
[30:42] Summary
#adventofcode #python