← Quiz: Interval Problems: all 10 questions
Quiz: Interval Problems · Question 2 of 10
Why must intervals be sorted by start before merging?
Why must intervals be sorted by start before merging?
- A.Sorting removes duplicates
- B.Python requires sorted lists
- C.After sorting, a new interval can only overlap the last merged block, so one pass is enough
- D.It makes every interval the same length
Answer & explanation
Correct answer: After sorting, a new interval can only overlap the last merged block, so one pass is enough
Without sorting, an interval could overlap a block built much earlier.
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 →