Python | O(n)
class Solution:\n    def minNumberOfHours(self, initialEnergy: int, initialExperience: int, energy: List[int], experience: List[int]) -> int:\n        sol=0\n  
```class Solution:\n    def minNumberOfHours(self, initialEnergy: int, initialExperience: int, energy: List[int], experience: List[int]) -> int:\n        sol=0\n        for i in range(len(energy)):\n            if(initialEnergy<=energy[i]):  \n                sol+=(energy[i]-initialEnergy+1)\n                initialEnergy+=(energy[i]-initialEnergy+1)\n            if(initialExperience<=experience[i]):\n                sol+=(experience[i]-initialExperience+1)\n                initialExperience+=(experience[i]-initialExperience+1)\n            initialEnergy-=energy[i]\n            initialExperience+=experience[i]\n        return sol\n```\n
['Array']