[Python] Greedy, sort first by gap, then by required start energy
Not exactly sure why this works, but we know that we probably want to do the tasks with small gaps last, and the tasks with the largest required start energy fi
Not exactly sure why this works, but we know that we probably want to do the tasks with small gaps last, and the tasks with the largest required start energy first. \n\n```\nclass Solution:\n    def minimumEffort(self, tasks: List[List[int]]) -> int:\n        tasks.sort(key = lambda x: (-(x[1]-x[0]),-x[1]))\n        curr = 0\n        for i in range(len(tasks))[::-1]:\n            actual,needed = tasks[i]\n            curr = max(actual+curr,needed)\n        \n        return curr\n```
[]