C++ || Easy understanding
\nclass Solution {\npublic:\n    int minNumberOfHours(int ie, int ix,vector<int>& en, vector<int>& ex) {\n        int n=en.size();\n        int val=0; //total h
```\nclass Solution {\npublic:\n    int minNumberOfHours(int ie, int ix,vector<int>& en, vector<int>& ex) {\n        int n=en.size();\n        int val=0; //total hours needed\n        for(int i=0;i<n;i++){\n            if(en[i]>=ie){\n                val+=en[i]-ie+1; // adding additional hours in energy\n                ie+=en[i]-ie+1;\n            }\n            if(ex[i]>=ix){\n                val+=ex[i]-ix+1; // adding additional hours in experience\n                ix+=ex[i]-ix+1;\n            }\n            ie-=en[i];\n            ix+=ex[i];\n            \n        }\n        return val;\n        \n    }\n};\n```
['Greedy', 'C']