✅C++ | ✅Simple & Efficient Solution
\nclass Solution \n{\npublic:\n    int minNumberOfHours(int i, int e, vector<int>& ener, vector<int>& exp) \n    {\n        int cnt=0, diff;\n        for(int k=
```\nclass Solution \n{\npublic:\n    int minNumberOfHours(int i, int e, vector<int>& ener, vector<int>& exp) \n    {\n        int cnt=0, diff;\n        for(int k=0; k<ener.size(); k++)\n        {\n            if(i<=ener[k])\n            {\n                diff = (ener[k]-i+1);\n                i += diff;\n                cnt += diff;\n            }\n            if(e<=exp[k])\n            {\n                diff = (exp[k]-e+1);\n                e += diff;\n                cnt += diff;\n            }\n            \n            i -= ener[k];\n            e += exp[k];\n                \n        }\n        return cnt;\n        \n        \n    }\n};\n```
['C', 'C++']