Python3 sort by end, no reverse order
```\nclass Solution:\n    def maxTaxiEarnings(self, n: int, rides: List[List[int]]) -> int:\n        rides = sorted(rides, key=lambda x: x[1])\n        E = [i[1
```\nclass Solution:\n    def maxTaxiEarnings(self, n: int, rides: List[List[int]]) -> int:\n        rides = sorted(rides, key=lambda x: x[1])\n        E = [i[1] for i in rides]\n        \n        m = len(rides)\n        dp = [0]*(m+1)\n        for k in range(1, m+1):\n            temp = bisect.bisect_right(E, rides[k-1][0])\n            dp[k] = max(dp[k-1], rides[k-1][2] - rides[k-1][0] + rides[k-1][1] + dp[temp])\n            \n        return dp[-1]
[]