Easy to understand || 100% faster solution || O(n) approach
class Solution {\npublic:\n    int minNumberOfHours(int initialEnergy, int initialExperience, vector& energy, vector& experience) {\n        int n= experience.s
class Solution {\npublic:\n    int minNumberOfHours(int initialEnergy, int initialExperience, vector<int>& energy, vector<int>& experience) {\n        int n= experience.size();\n        int count =0;\n        for(int i=0;i<n;i++){\n            if(energy[i]>=initialEnergy){\n                int diff = energy[i]-initialEnergy;\n                initialEnergy += diff+1;\n                count += diff+1;\n            }\n            if(experience[i]>=initialExperience){\n                int diff = experience[i]-initialExperience;\n                initialExperience += diff+1;\n                count += diff+1;\n            }\n            if(energy[i]<initialEnergy && experience[i]<initialExperience){\n                initialEnergy -= energy[i];\n                initialExperience += experience[i];\n            }\n            \n        }\n        return count;\n    }\n};
['C']