Cloze

Non-overlapping Intervals

Greedy, by end · O(n log n) time, O(1) extra space · LeetCode ↗

intervals are pairs of start and end. Find the fewest to remove so that none of the rest overlap. Intervals that only touch at an end do not overlap.