Non-overlapping Intervals
https://leetcode.com/problems/non-overlapping-intervals/description/
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.
Thoughts
https://en.wikipedia.org/wiki/Interval_scheduling#Interval_Scheduling_Maximization
Code
Analysis
时间复杂度O(nlgn)
Last updated
Was this helpful?