Problem
An interval [a, b] is covered by [c, d] when c <= a and b <= d. Remove every interval that is covered by another interval in the list, and return how many remain.
Example 1
- Input
- [[1, 4], [3, 6], [2, 8]]
- Output
- 2
- Why
- [3, 6] is covered by [2, 8]
Example 2
- Input
- [[1, 4], [2, 3]]
- Output
- 1
Constraints
1 <= intervals.length <= 10000 <= start < end <= 10^5All the intervals are unique.