Skip to content

Latest commit

 

History

History
10 lines (10 loc) · 468 Bytes

File metadata and controls

10 lines (10 loc) · 468 Bytes
  • Type: Binary search
  • Approach:
    • Find the right relationship for each interval by binary search
      1. Sort the original intervals array by start time.
      2. Use a new array to store all start times.
      3. For each interval, find the start time in sorted start times which is the end time of the interval we focus by binary search.
  • Complexity:
    • Time: O(nlogn)
    • Space: O(n)