Question
Given an array of intervals intervals
where intervals[i] = [starti, endi]
, return the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping.
https://leetcode.com/problems/non-overlapping-intervals/
- Solution1
1 | class Solution { |
Complexity:
Time complexity: O( nlogn)
Space complexity: O(1)