C++ || Easy || Simple and Fast code || O(n) solution
\nclass Solution {\npublic:\n    int minNumberOfHours(int initialEnergy, int initialExperience, vector<int>& energy, vector<int>& experience) {\n        int n=e
```\nclass Solution {\npublic:\n    int minNumberOfHours(int initialEnergy, int initialExperience, vector<int>& energy, vector<int>& experience) {\n        int n=energy.size();\n        int sum=0 ;\n        int reqEnergy=1;\n        for(int i=0 ; i<n ; i++){\n            int temp=experience[i];\n            experience[i]=experience[i]-sum;\n            sum+=temp;\n            reqEnergy+=energy[i];\n        }\n        int ans1=0;\n        if(reqEnergy>initialEnergy){\n            ans1=reqEnergy-initialEnergy;\n        }\n        else{\n            ans1=0;\n        }\n        // cout<<reqEnergy;\n        \n        sum=*max_element(experience.begin(),experience.end())+1;\n        \n        if(sum>=initialExperience){\n            sum=sum-initialExperience;\n        }\n        else{\n            sum=0;\n        }\n        \n        int ans=ans1+sum;\n        return ans;\n    }\n};\n```
['C', 'Iterator', 'C++']