Python binary search
```\nclass Solution:\n    def minimumEffort(self, tasks: List[List[int]]) -> int:\n            tasks.sort(key=lambda x:x[1]-x[0] ,reverse=True)\n            n=l
```\nclass Solution:\n    def minimumEffort(self, tasks: List[List[int]]) -> int:\n            tasks.sort(key=lambda x:x[1]-x[0] ,reverse=True)\n            n=len(tasks)\n            l=1\n            h=10**10\n            while l<=h:\n                mid=(l+h)//2\n                ans=mid\n                flag=True\n                for i in range(n):\n                    if ans>=tasks[i][1]:\n                        ans-=tasks[i][0]\n                    else:\n                        flag=False\n\n                if flag:\n                    h=mid-1\n                else:\n                    l=mid+1\n            return l
['Binary Tree', 'Python']