Simple Python solution using sort
\ndef minimumEffort(self, tasks: List[List[int]]) -> int:\n        tasks.sort(key=lambda a:a[1]-a[0],reverse=True)\n        res,curr=0,0\n        for i,j in tas
```\ndef minimumEffort(self, tasks: List[List[int]]) -> int:\n        tasks.sort(key=lambda a:a[1]-a[0],reverse=True)\n        res,curr=0,0\n        for i,j in tasks:\n            if curr<j:\n                res+=j-curr\n                curr=j\n            curr-=i\n        return res\n```
[]