Two pointers
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```csharp []
public class Solution {
    public int MinNumberOfHours(int initialEnergy, int initialExperience, int[] energy, int[] experience) {
        int sumEnergy = 0, h = 0;
        foreach(int e in energy)
        {
            sumEnergy += e;
        }

        h = (sumEnergy+1-initialEnergy > 0 ? sumEnergy+1-initialEnergy : 0) ;

        int preExp = initialExperience;
        foreach(int exp in experience)
        {
            if(preExp >= exp+1)
            {
               preExp += exp;
            }
            else
            {
                int gap = (exp+1-preExp);
                h += gap;
                preExp += (gap+exp);
            }
        }

        return h;
    }
}
```
['C#']