You are given an array events, where each element is a list [startDay_i, endDay_i, value_i] describing an event that starts on day startDay_i, ends on day endDay_i, and provides a value of value_i if you attend it.
You may attend at most k events. Attending an event requires you to be available for every day from startDay_i through endDay_i inclusive, so you cannot attend two events whose date ranges overlap.
Return the maximum total value you can obtain by attending at most k non overlapping events.
Note: You are not required to attend exactly
kevents.
Constraints:
k events.length
k events.length
startDay_i endDay_i
value_i
You are given an array events, where each element is a list [startDay_i, endDay_i, value_i] describing an event that starts on day startDay_i, ends on day endDay_i, and provides a value of value_i if you attend it.
You may attend at most k events. Attending an event requires you to be available for every day from startDay_i through endDay_i inclusive, so you cannot attend two events whose date ranges overlap.
Return the maximum total value you can obtain by attending at most k non overlapping events.
Note: You are not required to attend exactly
kevents.
Constraints:
k events.length
k events.length
startDay_i endDay_i
value_i