C++ Solution by Raj➡️ 💯%
\n\n# Code\n\nclass Solution {\npublic:\n    int minNumberOfHours(int E, int EX, vector<int>& e, vector<int>& ex) {\n        int n = e.size();\n        int i = 
![image.png](https://assets.leetcode.com/users/images/405d2150-9837-4e14-bc2b-73f7e24cfff4_1706286513.5845444.png)\n\n# Code\n```\nclass Solution {\npublic:\n    int minNumberOfHours(int E, int EX, vector<int>& e, vector<int>& ex) {\n        int n = e.size();\n        int i = 0, ans = 0;\n        while(i<n){\n            if(E<=e[i]){\n                int temp = e[i] - E;\n                ans += temp + 1;\n                E = E + temp + 1;\n            }\n            else if(EX<=ex[i]){\n                int temp2 = ex[i] - EX;\n                ans += temp2 + 1;\n                EX = EX + temp2 + 1;\n            }\n            else{\n                E = E - e[i];\n                EX = EX + ex[i];\n                i++;\n            }\n        }\n        return ans;\n    }\n};\n```
['C++']