Easy Solution
Intuition\n Describe your first thoughts on how to solve this problem. \nThe intiuition of the solution is to solve the problem using python programming languag
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nThe intiuition of the solution is to solve the problem using python programming language.\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution(object):\n    def minimumEffort(self, tasks):\n        """\n        :type tasks: List[List[int]]\n        :rtype: int\n        """\n        tasks.sort(key=lambda x: x[0] - x[1]) \n        answer = current = 0\n        for energy_cost, energy_min in tasks:\n            if energy_min > current:\n                answer += (energy_min - current)\n                current = energy_min\n            current -= energy_cost\n        return answer\n\n```
['Python']