Quiz: Interval Problems

Test your understanding

Check Your Understanding

When merging overlapping intervals, why do you sort by start time first?

  1. A.It makes the output look cleaner
  2. B.It reduces time complexity from O(n2)O(n^2) to O(n)O(n)
  3. C.After sorting, you only need to compare each interval with the previous one
  4. D.It ensures the algorithm uses less memory
Start the roadmap to answer the quizzes and solve the challenges