← Quiz: Interval Problems: all 10 questions
Quiz: Interval Problems · Question 9 of 10
Why can arrivals and departures be sorted separately in the platforms problem?
Why can arrivals and departures be sorted separately in the platforms problem?
- A.Because every train arrives and leaves at the same time
- B.Because the input is always sorted
- C.Only the number of trains present matters, not which train is which
- D.Because departures are always later than all arrivals
Answer & explanation
Correct answer: Only the number of trains present matters, not which train is which
The count at any moment depends only on how many arrivals and departures happened before it.
Can you get the rest right without peeking?
Take the timed Quiz: Interval Problems quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →