[Python] Heap for (end, val) | O(NlogN)
O(NlogN) | O(N)\n1. Sort by start time\n2. Clean all elements from the heap with end < start and keep max V as res1\n3. Calculate max sum for at most two as res
O(NlogN) | O(N)\n1. Sort by start time\n2. Clean all elements from the heap with end < start and keep max V as res1\n3. Calculate max sum for at most two as res2, where res1 is largest v with end < current start\n3. Populate the heap at each event with (end, val) to consider it later, after we\'ll reach first start > this end\n\n```\nclass Solution:\n    def maxTwoEvents(self, events: List[List[int]]) -> int:\n        events.sort()\n        heap = [] # (end, val)\n        res1 = res2 = 0 # res1 - max for one, res2 - max sum of at most two\n        for s, e, v in events:\n            while heap and heap[0][0] < s:\n                res1 = max(res1, heapq.heappop(heap)[1])\n            res2 = max(res2, res1 + v)            \n            heapq.heappush(heap, (e, v))\n        return res2\n```
[]