435 Non-overlapping Intervals
Given a collection of intervals, find the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping.
Note:
You may assume the interval's end point is always bigger than its start point.
Intervals like [1,2] and [2,3] have borders "touching" but they don't overlap each other.
Example 1:
Example 2:
Example 3:
The Idea: This is uni-weight interval scheduling problem. Sort by finish, then increment every-time it overlaps with the previous valid interval.
Complexity: O(nlogn +n) time, O(1) space
Last updated