✅✅100% |✅ Easy Approach | C++ | Basic For Loop O(n)
Please Upvote\n\n\nint minNumberOfHours(int e, int ex, vector<int>& energy, vector<int>& experience) {\n        int count=0;\n        for(int i=0;i<energy.size(
**Please Upvote**\n\n```\nint minNumberOfHours(int e, int ex, vector<int>& energy, vector<int>& experience) {\n        int count=0;\n        for(int i=0;i<energy.size();i++){\n            if(energy[i]>=e){\n                while(e<=energy[i]){\n                    e++;\n                    count++;\n                }\n            }\n            if(experience[i]>=ex){\n                while(ex<=experience[i]){\n                    ex++;\n                    count++;\n                }\n            }\n            ex+=experience[i];\n            e-=energy[i];\n        }\n        return count;\n    }\n```
['Array', 'Greedy', 'C', 'C++', 'Java']