Maximum Number of Events That Can Be Attended
Last updated
Last updated
Given an array of events
where events[i] = [startDayi, endDayi]
. Every event i
starts at startDayi
and ends at endDayi
.
You can attend an event i
at any day d
where startTimei <= d <= endTimei
. Notice that you can only attend one event at any time d
.
Return the maximum number of events you can attend.
Example 1:
Example 2:
Example 3:
Example 4:
Example 5:
Constraints:
1 <= events.length <= 10^5
events[i].length == 2
1 <= events[i][0] <= events[i][1] <= 10^5