Javascript Solution
\nvar minNumberOfHours = function(initialEnergy, initialExperience, energy, experience) {\n    let count = 0\n    for (let i=0; i<energy.length; i++) {\n       
```\nvar minNumberOfHours = function(initialEnergy, initialExperience, energy, experience) {\n    let count = 0\n    for (let i=0; i<energy.length; i++) {\n        if (energy[i]>=initialEnergy) {\n            count+=energy[i]-initialEnergy+1\n            initialEnergy = 1\n        } else {\n            initialEnergy -= energy[i]\n        } \n        if (experience[i]<initialExperience) {\n            initialExperience += experience[i]\n        } else {\n            count+=experience[i]-initialExperience+1\n            initialExperience += experience[i]+experience[i]-initialExperience+1       \n        }\n       \n    }\n    return count\n};\n```
['JavaScript']