Problem
events[i] = [start, end] means event i can be attended on any single day d with start <= d <= end. You can attend only one event per day, and attending an event takes just that one day. Return the maximum number of events you can attend.
Example 1
- Input
- [[1, 2], [2, 3], [3, 4]]
- Output
- 3
- Why
- day 1, day 2, day 3
Example 2
- Input
- [[1, 2], [2, 3], [3, 4], [1, 2]]
- Output
- 4
Example 3
- Input
- [[1, 1], [1, 1], [1, 1]]
- Output
- 1
Constraints
1 <= events.length <= 10^51 <= start <= end <= 10^5