Fundamentals/Turnstile | Hackerank SHL
← PrevNext →
Given n customers with arrival times and direction (0 = exit, 1 = enter), and a turnstile that allows one person per second with the rule that exit takes priority unless someone just used it for entry, return the time each customer crosses.