Track the largest and second largest
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 FillCups(int[] amount) {
        // sort amount
    
        Array.Sort(amount);
        if(amount[1]+ amount[0] <= amount[2])
            return amount[2];

        int res = 0;
        while(amount[2] >0)
        {
            if (amount[0] == 0)
            {
				res += Math.Max(amount[1], amount[2]);
				return res;
            }
            int diff =  amount[2]-amount[0] == 0 ? 1 : amount[2]-amount[0];

            res += diff;
            amount[2] -= diff;
            amount[1] -= diff;
            
            Array.Sort(amount);
        }

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