Race Condition [Day 20 - Advent of Code 2024 - Python] @0xdf
Race Condition [Day 20 - Advent of Code 2024 - Python]  @0xdf
Uploaded December 2024 | Updated November 2026, 3 hours ago
I'm given a maze to work through, which is very easy. But, then I'm told I'm allowed a single shortcut of length two, effectively once walking through a wall, and I need to find the number of shortcuts that improve my time by at least 100 steps. I'll create a map of each position that can be visited and compare each pair of points to see if a shortcut is possible. In part 2, I'm allow to go through much thicker walls, up to 19 spaces. The same logic applies.

2024 AOC repo: gitlab.com/0xdf/aoc2024
2024 AOC Intro video: youtube.com/watch?v=4XKZZrhhiQE
VSCode Debug video: youtube.com/watch?v=cNhtk2Ob4B8

☕ Buy Me A Coffee: buymeacoffee.com/0xdf

[00:00] Part1 introduction
[01:40] Strategy
[02:48] Setup / data overview
[03:25] Parsing input
[03:58] Getting start
[04:58] Calculating distance to each spot with bfs
[08:16] Debugging infinite loop
[09:38] Adding second seen check
[10:24] Finding shortcuts
[14:10] Checking examples
[14:47] Counting shortcuts
[15:06] Solving part 1
[15:25] Part 2 challenge
[16:30] Modifying loop to search more widely
[22:09] Collecting solution
[23:57] Solving part 2
[24:13] Conclusion

#adventofcode #python
Race Condition [Day 20 - Advent of Code 2024 - Python]Brute-Forcing File Read with MD5s [HackTheBox Intentions]Digging into OFBiz ExploitationAdvent of Code 2025 - PreviewDay 8: Haunted Wasteland [AOC2023 Python]Historian Hysteria [Day 1 - Advent of Code 2024 - Python]Plutonian Pebbles [Day 11 - Advent of Code 2024 - Python]State of 0xdf (2026)Day 19: Aplenty [AOC2023 Python]Day 3: Gear Ratios [AOC2023 Python]Creating VMs with VagrantAnalysis of CVE-2023-37474 in CopyParty
0xdf |

Race Condition [Day 20 - Advent of Code 2024 - Python]

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER