Java Solution
```java\nclass Solution {\n    public int minNumberOfHours(int initialEnergy, int initialExperience, int[] energy, int[] experience) {\n        int n = energy.l
```java\nclass Solution {\n    public int minNumberOfHours(int initialEnergy, int initialExperience, int[] energy, int[] experience) {\n        int n = energy.length;\n        int enSum = 0;\n        for(int en : energy) {\n            enSum += en;\n        }\n        int ans1 = enSum >= initialEnergy ? Math.abs(enSum - initialEnergy) + 1 : 0;\n        int ans2 = 0;\n        for(int i = 0; i < n; i++) {\n            if(initialExperience <= experience[i]) {\n                ans2 += (experience[i] - initialExperience) + 1;\n                initialExperience += (ans2 + experience[i]);\n            }\n            else {\n                initialExperience += experience[i];\n            }\n            \n            System.out.println(initialExperience);\n        }\n        System.out.println(ans1 + " " + ans2);\n        return ans1 + ans2;\n    }\n}
['Greedy']