C# simple solution plus 1-liner Linq bonus | 70ms 100%
More intuitive for experience diff (code optimized below)\n\npublic class Solution {\n    public int MinNumberOfHours(\n        int initialEnergy, int initialEx
More intuitive for experience diff (code optimized below)\n```\npublic class Solution {\n    public int MinNumberOfHours(\n        int initialEnergy, int initialExperience, int[] energy, int[] experience) \n    {\n        var hours = Math.Max(0, energy.Sum()+1-initialEnergy);  // extra energy\n\n        foreach(var current in experience)\n        {\n            var diff = initialExperience - current;\n\n            diff = diff > 0 ? 0 : 1 - diff;\n\n            hours += diff;\n\n            initialExperience += diff + current;\n        }\n\n        return hours;\n    }\n}\n```\nwith some refactoring for diff\n```\npublic class Solution {\n    public int MinNumberOfHours(\n        int initialEnergy, int initialExperience, int[] energy, int[] experience) \n    {\n        var hours = Math.Max(0, energy.Sum()+1-initialEnergy);  // extra energy\n\n        foreach(var current in experience)\n        {\n            var diff = 1 - Math.Min(1, initialExperience-current);\n\n            hours += diff;\n\n            initialExperience += diff + current;\n        }\n\n        return hours;\n    }\n}\n```\n# "1-liner" with Linq\n(Not exactly pure 1-liner. Maybe Linq\'s guru could turn it to true 1-liner)\n```\npublic class Solution {\n    public int MinNumberOfHours(\n        int initialEnergy, int initialExperience, \n        int[] energy, int[] experience) \n\n    => Math.Max(0, energy.Sum()+1-initialEnergy)\n      + experience.Sum(exp =>\n        {\n            var diff = 1 - Math.Min(1, initialExperience - exp);\n\n            initialExperience += diff + exp;\n\n            return diff;\n        });\n}\n```\nThis is like true 1-liner if re-use optional diff=0 parameter in method\'s singnature\n```\npublic class Solution {\n    public int MinNumberOfHours(\n        int initialEnergy, int initialExperience, \n        int[] energy, int[] experience, int diff = 0) \n\n    => Math.Max(0, energy.Sum()+1-initialEnergy)\n      + experience.Sum(exp =>\n         new {\n            diffForSum = (diff = 1-Math.Min(1, initialExperience - exp)),\n            _ = (initialExperience += diff + exp)\n        }.diffForSum);\n}\n```
['C#']