Day 21: Step Counter [AOC2023 Python] @0xdf
Day 21: Step Counter [AOC2023 Python]  @0xdf
Uploaded December 2023 | Updated November 2026, 10 hours ago
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: gitlab.com/0xdf/aoc2023
Challenge Link: adventofcode.com/2023/day/121

☕ Buy Me A Coffee: 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
Day 21: Step Counter [AOC2023 Python]Exploring Docker Registry Auth [HackTheBox RegistryTwo]Day 1 - No time for a Taxicab [Revival of Code 2023 - Advent of Code 2016]Python Directory Traversal Exploit [Yummy - HackTheBox]Addition [HackTheBox - Coding Challenge]Binary Analysis of notes [HackTheBox Gofer]Configuring VSCode to Debug PyTestExploring a Flask App with SSTI [HackTheBox Sandworm]Day 22: Monkey Map [AOC2022 Python]
0xdf |

Day 21: Step Counter [AOC2023 Python]

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER