Easy Understanding || 100% Faster
\nclass Solution {\npublic:\n    int minNumberOfHours(int ie, int ig, vector<int>& energy, vector<int>& experience) \n    {\n        int hours = 0;\n        for
```\nclass Solution {\npublic:\n    int minNumberOfHours(int ie, int ig, vector<int>& energy, vector<int>& experience) \n    {\n        int hours = 0;\n        for (int i = 0; i < energy.size(); i++)\n        {\n            if (energy[i] >= ie)\n            {\n                hours += energy[i] - ie + 1;\n                ie += energy[i] - ie + 1;\n            }\n            if (experience[i] >= ig)\n            {\n                hours += experience[i] - ig + 1;\n                ig += experience[i] - ig + 1;\n            }\n\t\t\t// At the end increase the experience by experience[i] and decrease the energy by energy[i].\n            ie -= energy[i];\n            ig += experience[i];\n        }\n        return hours;\n    }\n};\n```
['Array', 'C', 'C++']