[Python]: Binary Search + DP
\nclass Solution:\n    def maxTwoEvents(self, events: List[List[int]]) -> int:\n        def binarySearch(low, high, key):\n            if low <= high:\n        
```\nclass Solution:\n    def maxTwoEvents(self, events: List[List[int]]) -> int:\n        def binarySearch(low, high, key):\n            if low <= high:\n                mid = (low+high)//2\n                if events[mid][1] >= key:\n                    return binarySearch(low, mid-1, key)\n                else:\n                    return binarySearch(mid+1, high, key)\n            return high\n        \n        events.sort(key=lambda x: x[1])\n        dp = [0 for _ in range(len(events))]\n        dp[0] = events[0][2]\n        for i in range(1, len(events)):\n            dp[i] = max(dp[i-1], events[i][2]) # maximum values if only one selection was allowed         \n        \n        maxi = events[0][2]\n        \n        for i in range(1, len(events)):\n            cur = events[i][2]\n            prev =  binarySearch(0, len(events), events[i][0]) # previos non-overlapping index\n            maxi = max(maxi, cur+dp[prev]) if prev != -1 else max(maxi, cur)\n        return maxi\n```
['Dynamic Programming', 'Binary Tree', 'Python']