✅ O(n) approach || C++|| Easy to Understand || 100% faster
\nclass Solution {\npublic:\n    int minNumberOfHours(int initialEnergy, int initialExperience, vector<int>& energy, vector<int>& experience) {\n        \n     
```\nclass Solution {\npublic:\n    int minNumberOfHours(int initialEnergy, int initialExperience, vector<int>& energy, vector<int>& experience) {\n        \n        int n=energy.size();\n        int ans=0;\n        for(int i=0;i<n;i++){\n            if(energy[i]>=initialEnergy){\n                int dif=energy[i]-initialEnergy;\n                initialEnergy+=dif+1;\n                ans+=dif+1;\n            }\n            if(experience[i]>=initialExperience){\n                int dif=experience[i]-initialExperience;\n                initialExperience+=dif+1;\n                ans+=dif+1;\n            }\n            if(energy[i]<initialEnergy && experience[i]<initialExperience){\n                initialEnergy-=energy[i];\n                initialExperience+=experience[i];\n            }\n        }\n        return ans;\n    }\n};\n```
['C']