Skip to content
This repository was archived by the owner on Apr 20, 2024. It is now read-only.

Commit 246290f

Browse files
committed
added problem72
1 parent 67e0a9f commit 246290f

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

problem72/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# 435. Non-overlapping Intervals
2+
3+
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.
4+
5+
6+
## Example 1:
7+
8+
Input: intervals = [[1,2],[2,3],[3,4],[1,3]]
9+
Output: 1
10+
Explanation: [1,3] can be removed and the rest of the intervals are non-overlapping.
11+
12+
## Example 2:
13+
14+
Input: intervals = [[1,2],[1,2],[1,2]]
15+
Output: 2
16+
Explanation: You need to remove two [1,2] to make the rest of the intervals non-overlapping.
17+
18+
## Example 3:
19+
20+
Input: intervals = [[1,2],[2,3]]
21+
Output: 0
22+
Explanation: You don't need to remove any of the intervals since they're already non-overlapping.
23+
24+
25+
## Constraints:
26+
27+
1 <= intervals.length <= 105
28+
intervals[i].length == 2
29+
-5 * 104 <= starti < endi <= 5 * 104

0 commit comments

Comments
 (0)