2023 Day 8: Haunted Wasteland

Relatively straightforward. I suspected, correctly, that Part 2 would require the least common multiple of the individual ghosts’ times to reach a terminus. Unfortunately, I incremented my step counter at the wrong time, so that I didn’t see the regular cycle lengths of their paths.

I spent a long time trying to figure out my logic error that created an infinite loop. Finally, on my fifth rereading of the requirements, I realized I was supposed to start from AAA, not from the node on the third line in the input.

If I may ask, what was the third node in your input? and why did you think that?

Not third node; third line of the input file, which is the first line of the node map.

As to why, the examples all had AAA as the source node on the first line of the node map, and I somehow concluded that the reason that they started from AAA was because it was that first node, not because it was AAA. This idea was entrenched strongly enough that I misinterpreted the instruction to start from AAA the first few times I read it.

1 Like