you give array event eventsi startdayi enddayi valuei the ith event start startdayi end enddayi attend event receive value valuei you give integer k represent maximum number event attendyou attend event time if choose attend event attend entire event note end day inclusive attend event start end dayreturn maximum sum value receive attend event example 1input event 124343231 k 2output 7Explanation choose green event 0 1 0indexed total value 4 3 7example 2input event 1243432310 k 2output 10explanation Choose event 2 total value 10notice attend event overlap attend k eventsExample 3input event 111222333444 k 3output 9explanation although event overlap attend 3 event Pick highest value Constraints1 k eventslength1 k eventslength 1061 startdayi enddayi 1091 valuei 106