Back to problems

Maximum Number of Events That Can Be Attended II

Algorithm · Snowflake · Hard

You are given an array in which each event is represented as events[i] = [startDay_i, endDay_i, value_i]. Event i takes place from startDay_i through endDay_i, and attending it provides value_i. You may select no more than k events, but selected events must not overlap. When an attended event finishes on day d, any later attended event must begin strictly after day d. Find the greatest total value obtainable from attending at most k events. Examples Example 1: Input: events…

Checking your access…