2dbi

Maximum Number of Events That Can Be Attended

viaLeetCode

Given an array of events where events[i] = [startDay, endDay], and you can attend one event per day (any day in [startDay, endDay]), return the maximum number of events you can attend. Greedy: sort by start, use a min-heap of end days, and for each day attend the event ending soonest.

Add a follow-up question they asked
No follow-ups yet. Be the first to add one.
asked …
LeaderboardSalary
Language
Account