[C++] || O(N) Soluion
\nclass Solution {\npublic:\n    int minNumberOfHours(int en , int xp, vector<int>& energy, vector<int>& exp) {\n        \n        int timer = 0 ;\n        for(
```\nclass Solution {\npublic:\n    int minNumberOfHours(int en , int xp, vector<int>& energy, vector<int>& exp) {\n        \n        int timer = 0 ;\n        for(int i = 0 ; i < energy.size() ; ++i ){\n            if(en <= energy[i]) timer += energy[i] - en + 1 , en += energy[i] - en + 1 ;\n            if(xp <= exp[i]) timer += exp[i] - xp + 1, xp += exp[i] - xp + 1 ;\n            \n            en -= energy[i] ;  //energy will reduce\n            xp += exp[i] ;     //xp will increase\n        }\n        \n        return timer ;\n        \n    }\n};\n```
['C']