Four passes, then multiply
transcript
A robot follows a route. It repeats it a billion times. You cannot replay that. The input looks impossible, but a pattern hides in it.
Take the route forward, then turn right. Pass two ends at one, one, facing south. Pass four is back at the start, facing north.
After four passes the facing is the same. So every block of four moves it the same. Follow four passes, then multiply. The cycle is short, even when the count is huge.
One pass times the rounds ignores the turns. The next pass starts facing a new way. Only a route that keeps the facing allows it. Test a route that turns, such as forward then right.
Write the rounds as four times q, plus r. Multiply the four-pass move by q. Then add the move of r more passes. The rest is one more short loop.
Find the cycle first. Then jump over it. Full breakdown in the lecture.