Maximum Number of Events That Can Be Attended II
Given an array of events where events[i] = [startDay, endDay, value], and an integer k. You can attend at most k events. You cannot attend two events that overlap. Return the maximum sum of values that you can receive by attending events.
Maximum Number of Events That Can Be Attended II

Given an array of events where events[i] = [startDay, endDay, value], and an integer k. You can attend at most k events. You cannot attend two events that overlap. Return the maximum sum of values that you can receive by attending events.

Example 1:
Input: {"events":[[1,2,4],[3,4,3],[2,3,1]],"k":2}
Output: 7
Input
arr ={"events":[[1,2,4],[3,4,3],[2,3,1]],"k":2}

Events: 3, k=2

Events Timeline (k=2)

1

2

3

4

5

[1,2] v=4

[3,4] v=3

[2,3] v=1

Remaining slots: 2

Maximum Value:

?

Current

Selected

Variables
No variables to display
DepthFunction Call
Stack empty
0/1