DP + Binary search. Simple solution. 6 lines
\nclass Solution:\n    def maxTaxiEarnings(self, n: int, rides: List[List[int]]) -> int:\n        earn = [0]\n        rides.sort(key = itemgetter(1))\n        f
```\nclass Solution:\n    def maxTaxiEarnings(self, n: int, rides: List[List[int]]) -> int:\n        earn = [0]\n        rides.sort(key = itemgetter(1))\n        for i, (start, end, tip) in enumerate(rides):\n            j = bisect_right(rides, start, key = itemgetter(1), hi = i)\n            earn.append(max(end - start + tip + earn[j], earn[-1]))\n        return earn[-1]\n```
['Binary Search', 'Dynamic Programming', 'Python3']