C++ | easy solution using sorting
https://www.youtube.com/watch?v=CgaYzm3s1SU\n\nThe minimum energy required will be >= total energy of all tasks + some additional energy required for the tasks 
https://www.youtube.com/watch?v=CgaYzm3s1SU\n\nThe minimum energy required will be >= total energy of all tasks + some additional energy required for the tasks having "minimum energy" requirement >= actual energy requirement.\nso "total enery of all tasks" <= answer <= "total minimum energy of all tasks"\nKey points:\n1. To minimize the answer we need to process the tasks which have more gap between their actual and minimum energy requirement.\n2. Sort all these tasks accoring to the above ordering\n3. Calculate total energy of all tasks and start processing with this energy\n4. Add additional energy to answer wherever the minimum requirement is not satisfied using current total energy\n```\nclass Solution {\npublic:\n    static bool mysort(vector<int> &a, vector<int> &b) {\n        return (a[1] - a[0]) > (b[1] - b[0]);\n    }\n    int minimumEffort(vector<vector<int>>& tasks) {\n        sort(tasks.begin(), tasks.end(), mysort);\n        int total = 0;\n        for (auto task: tasks)\n            total += task[0];\n        int res = total;\n        for (auto task: tasks) {\n            if (task[1] > total) // If the tasks minimum requirement is more than current total energy\n                total += task[1] - total; // Add the additional energy required to the total \n            total -= task[0];\n        }\n        return res + total;\n    }\n};\n```
['C']