Optimized Greedy approach without binary search
Intuition\nsorting with respect to absolute difference between task[i][0] and task[i][1] will work.\n\n# Approach\nsorting with respect to absolute difference b
# Intuition\nsorting with respect to absolute difference between task[i][0] and task[i][1] will work.\n\n# Approach\nsorting with respect to absolute difference between task[i][0] and task[i][1] will work.\nthen we can use binary search for getting answer or we can maintain a sum variable with task[i][0] and take maximum out of it.\n\n# Complexity\n- Time complexity:\nO(n*log(n))\n\n- Space complexity:\nO(1)\n\n# Code\n```\nclass Solution {\npublic:\n    int minimumEffort(vector<vector<int>>& t) {\n        sort(t.begin(),t.end(),[&] (vector<int>&a,vector<int>&b){\n            return abs(a[0]-a[1])>abs(b[0]-b[1]);\n        });\n        int sum=0,ans=0;\n        for(int i=0;i<t.size();i++){\n            ans=max(ans,sum+t[i][1]);\n            ans=max(ans,sum+t[i][0]);\n            sum+=t[i][0];\n        }\n        return ans;\n    }\n};\n```
['C++']