Easy Code || 0ms || 100% Faster!! || C++ Solution
class Solution {\npublic:\n    int minNumberOfHours(int initialEnergy, int initialExperience, vector<int>& energy, vector<int>& experience) {\n        int hrs=0
```class Solution {\npublic:\n    int minNumberOfHours(int initialEnergy, int initialExperience, vector<int>& energy, vector<int>& experience) {\n        int hrs=0;\n        int sum=0;\n        int i=0;\n        for(int j=0;j<energy.size();j++)\n        {\n            sum=sum+energy[j];\n        }\n        if(initialEnergy<=sum)\n        { \n            hrs=(sum-initialEnergy)+1;\n            initialEnergy=initialEnergy+(sum-initialEnergy)+1;\n        }\n        while(i<experience.size())\n        {\n            if(initialEnergy>energy[i]&&initialExperience>experience[i])\n            {\n                initialExperience=initialExperience+experience[i];\n                i++;\n            }\n            else\n            { \n                hrs++;\n                initialExperience++;\n            }\n        }\n        return hrs;\n    }\n};\n```
['Array', 'C', 'C++']