Python Easy O(n)
\n# Code\n\nclass Solution:\n    def minNumberOfHours(self, initialEnergy: int, initialExperience: int, energy: List[int], experience: List[int]) -> int:\n\n   
\n# Code\n```\nclass Solution:\n    def minNumberOfHours(self, initialEnergy: int, initialExperience: int, energy: List[int], experience: List[int]) -> int:\n\n        \n        exdif = 0\n        ensum = 0\n        for i in range(len(energy)):\n\n            if initialExperience <= experience[i]:\n                exdif = max(1,exdif,experience[i]+1-initialExperience)\n\n            initialExperience += experience[i]\n            ensum += energy[i]\n\n\n        return max(ensum-initialEnergy+1,0) + exdif\n        \n```
['Python3']