[C++] Simple Solution
Code
# Code
```cpp []
class Solution {
public:
    int minNumberOfHours(int initialEnergy, int initialExperience, vector<int>& energy, vector<int>& experience) {
        int N = experience.size();
        int ans = 0;

        int x = initialExperience;
        for(int i=0; i<N; i++) {
            if(x < experience[i]+1) {
                ans += (experience[i]+1 - x);
                x = experience[i]+1;
            }
            x += experience[i];
        }

        x = initialEnergy;
        for(int i=0; i<N; i++) {
            if(x < energy[i]+1) {
                ans += (energy[i]+1 - x);
                x = energy[i]+1;
            }
            x -= energy[i];
        }

        return ans;
    }
};
```
['C++']