DEV Community

Discussion on: Advent of Code 2019 Solution Megathread - Day 20: Donut Maze

Collapse
 
neilgall profile image
Neil Gall

Part 2 of this one has me quite confused. The level shifting seems straightforward but the example given has the possibility to loop ever deeper into the maze, which you have to detect and prevent. I've tried various ideas of checking past transits through the same portal in the same direction for equally spaced level deltas, etc., but I seem to be closing off valid routes and exiting the search without an answer. I think I'm missing some important detail of the representation of the portals that would make things much simpler. Any tips?