1
class Solution:
2
def maxTwoEvents(self, events: List[List[int]]) -> int:
3

4
events.sort()
5
heap = []
6
res2, res1 = 0, 0
7
for s, e, p in events:
8
while heap and heap[0][0] < s:
9
res1 = max(res1, heapq.heappop(heap)[1])
10

11
res2 = max(res2, res1 + p)
12
heapq.heappush(heap, (e, p))
13

14
return res2

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0