100% faster JAVA AC | O(n)
\n\t \n\t class Solution {\n    public int minNumberOfHours(int initialEnergy, int initialExperience, int[] energy, int[] experience) {\n        \n        int s
\n\t \n\t class Solution {\n    public int minNumberOfHours(int initialEnergy, int initialExperience, int[] energy, int[] experience) {\n        \n        int sum=0;\n        for(int i:energy)\n            sum+=i;\n        int hours = sum>=initialEnergy?sum-initialEnergy+1:0;\n        for(int i=0;i<experience.length;i++)\n        {\n            if(experience[i]<initialExperience)\n                initialExperience+=experience[i];\n            else{\n                hours+= experience[i]-initialExperience + 1;\n                initialExperience+= experience[i]-initialExperience + 1 + experience[i];\n                \n            }\n        }\n        return hours;\n    }\n    }
['Java']