✅ One Line Solution
Binary Search + Right Max \n(Disclaimer: this is not an example to follow in a real project - it is written for fun and training mostly)\n\n# Code #1.1 - Three 
<!--Binary Search + Right Max-->\n(Disclaimer: this is not an example to follow in a real project - it is written for fun and training mostly)\n\n# Code #1.1 - Three Lines\nTime complexity: $$O(n*log(n))$$. Space complexity: $$O(n)$$.\n```python3\nclass Solution:\n    def maxTwoEvents(self, a: List[List[int]]) -> int:\n        S,_,V = zip(*(a:=sorted(a)))\n        M = [0,*accumulate(V[::-1],max)][::-1]\n        return max(v+M[bisect_right(S,e)] for _,e,v in a)\n```\n\n# Code #1.2 - One Line\n```python3\nclass Solution:\n    def maxTwoEvents(self, a: List[List[int]]) -> int:\n        return max((M:=[0,*accumulate(map(itemgetter(2),(a:=sorted(a))[::-1]),max)][::-1])+[v+M[bisect_right(a,e,key=itemgetter(0))] for _,e,v in a])\n```\n\n# Code #1.3 - Unwrapped\n```python3\nclass Solution:\n    def maxTwoEvents(self, events: List[List[int]]) -> int:\n        START, END, VAL = 0, 1, 2\n\n        events.sort()        \n        maxRightVal = [0, *accumulate(map(itemgetter(VAL), events[::-1]), max)][::-1]\n        res = 0\n        for _, end, val in events:\n            j = bisect_right(events, end, key=itemgetter(START))\n            res = max(res, val + maxRightVal[j])\n        \n        return res\n```\n\n# Code #2.1 - Two Lines\nTime complexity: $$O(n*log(n))$$. Space complexity: $$O(n)$$.\n```python3\nclass Solution:\n    def maxTwoEvents(self, a: List[List[int]]) -> int:\n        t,M = sorted((q[k]+k,k^1,q[2]) for q in a for k in (0,1)),0\n        return max(p and v+M or (M:=max(M,v)) for _,p,v in t)\n```\n\n# Code #2.2 - One Line\n```python3\nclass Solution:\n    def maxTwoEvents(self, a: List[List[int]]) -> int:\n        return (t:=sorted((q[k]+k,k^1,q[2]) for q in a for k in (0,1)),M:=0) and max(p and v+M or (M:=max(M,v)) for _,p,v in t)\n```\n\n(Disclaimer 2: code above is just a product of fantasy packed into one line, it is not claimed to be \'true\' oneliners - please, remind about drawbacks only if you know how to make it better)
['Array', 'Binary Search', 'Sorting', 'Prefix Sum', 'Python', 'Python3']