Class Solution
- java.lang.Object
-
- g1301_1400.s1353_maximum_number_of_events_that_can_be_attended.Solution
-
public class Solution extends Object
1353 - Maximum Number of Events That Can Be Attended.Medium
You are given an array of
eventswhereevents[i] = [startDayi, endDayi]. Every eventistarts atstartDayiand ends atendDayi.You can attend an event
iat any daydwherestartTimei <= d <= endTimei. You can only attend one event at any timed.Return the maximum number of events you can attend.
Example 1:

Input: events = [[1,2],[2,3],[3,4]]
Output: 3
Explanation: You can attend all the three events.
One way to attend them all is as shown.
Attend the first event on day 1.
Attend the second event on day 2.
Attend the third event on day 3.
Example 2:
Input: events= [[1,2],[2,3],[3,4],[1,2]]
Output: 4
Constraints:
1 <= events.length <= 105events[i].length == 21 <= startDayi <= endDayi <= 105
-
-
Constructor Summary
Constructors Constructor Description Solution()
-