Back to DSA
Non-overlapping Intervals
mediumGiven a collection of intervals [start, end], find the smallest number of intervals to discard so that the remaining intervals are all mutually non-overlapping.
Examples
Example 1:
Input:
intervals = [[1,3],[2,4],[3,5],[4,6]]Output:
1 Example 2:
Input:
intervals = [[1,3],[1,3],[1,3]]Output:
2Hints
1234567