Company: Deshaw_16sep
Difficulty: medium
Passenger Processing Times Problem Description An airport has exactly one security scanner. It can be used either for arrivals or departures. Unfortunately, sometimes many passengers arrive at the scanner at the same time with different travel directions. The i th passenger arrives at the scanner at time[i] and wants to either go to departures if direction[i] = 1 or go to arrivals if direction[i] = 0 . Passengers form 2 lines, one for departures and one for arrivals. They are ordered by the time when they arrived at the scanner and, if the times are equal, by their passenger IDs. If a departing passenger and an arriving passenger reach the scanner at the same moment, there are three cases: If in the previous second the scanner was not used (maybe it was used before, but not at the previous second), then the departing passenger goes first. If in the previous second the scanner was used for departures, then the departing passenger goes first. If in the previous second the scanner was use