-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
blind-75Blind 75 - Blind-75 problemsBlind 75 - Blind-75 problemsintervalBlind 75 - Interval problemsBlind 75 - Interval problems
Description
LeetCode 435: Non-overlapping Intervals
Category: Interval
Difficulty: See LeetCode
Solution File: src/interval/non_overlapping_intervals.py
Test File: tests/test_non_overlapping_intervals.py
Problem Description
Given an array of 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.
Example 1:
Input: intervals = [[1,2],[2,3],[3,4],[1,3]]
Output: 1
Explanation: [1,3] can be removed and the rest are non-overlapping.
Example 2:
Input: intervals = [[1,2],[1,2],[1,2]]
Output: 2
Constraints:
- 1 <= intervals.length <= 10^5
- intervals[i].length == 2
Tasks
- Implement the solution in
src/interval/non_overlapping_intervals.py - Ensure all test cases pass
- Analyze time complexity
- Analyze space complexity
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
blind-75Blind 75 - Blind-75 problemsBlind 75 - Blind-75 problemsintervalBlind 75 - Interval problemsBlind 75 - Interval problems