Problem 2534 · Hard

Time Taken to Cross the Door

Simulate each second: the door keeps its last direction when both directions wait, and exiting wins after an idle second.

Open the interactive visualisation