c++ solution
\nclass Solution {\npublic:\n    int minNumberOfHours(int ini, int ie, vector<int>&numse, vector<int>& numsx)\n    {\n        int n=numse.size();\n        int v
```\nclass Solution {\npublic:\n    int minNumberOfHours(int ini, int ie, vector<int>&numse, vector<int>& numsx)\n    {\n        int n=numse.size();\n        int val1=ini;\n        int count1=0;\n        for(int i=0;i<n;i++)\n        {\n            if(numse[i]>=val1)\n            {\n                count1+=(numse[i]-val1+1);\n                val1+=(numse[i]-val1+1);\n            }\n            val1-=numse[i];\n        }\n         int val2=ie;\n        int count2=0;\n        for(int i=0;i<n;i++)\n        {\n            if(numsx[i]>=val2)\n            {\n                count2+=(numsx[i]-val2+1);\n                val2+=(count2);\n            }\n            val2+=numsx[i];\n        }\n        // cout<<count1<<" "<<count2<<endl;\n        return count1+count2;\n    }\n};\n```
['C', 'C++']