Java Easy Solution | O(n)
```\npublic int minNumberOfHours(int initialEnergy, int initialExperience, int[] energy, int[] experience) {\n        int res =0;\n        int n= energy.length;
```\npublic int minNumberOfHours(int initialEnergy, int initialExperience, int[] energy, int[] experience) {\n        int res =0;\n        int n= energy.length;\n        int energySum =0;\n        for(int i=0;i<n;i++){\n            energySum+=energy[i];\n            \n        }\n        res=energySum-initialEnergy>=0 ? energySum-initialEnergy+1:0;\n        \n        \n         for(int i=0;i<n;i++){\n           if(initialExperience<=experience[i]){\n               res+=experience[i]-initialExperience+1;\n               initialExperience = experience[i]+1;\n           }\n             initialExperience+=experience[i];\n        }\n        return res;\n    }
['Array', 'Java']