Problems > Elevator Log > Editorial

Elevator Log — Solution & Editorial

Back to the Problem

Track the running floor plus min and max as you go (0 counts — the start).

Complexity: O(N)