C# Greedy Solution
Intuition\n-  Describe your first thoughts on how to solve this problem. The intuition behind solving this problem is to minimize the number of seconds needed t
# Intuition\n- <!-- Describe your first thoughts on how to solve this problem. -->The intuition behind solving this problem is to minimize the number of seconds needed to fill the cups by always maximizing the number of cups filled at each step. When I read the problem, my first thought was to try to fill two cups whenever possible, as this will clearly reduce the total number of seconds compared to filling just one cup at a time. Specifically, it seemed optimal to always pick the two largest numbers (representing the two types of water with the most cups left to fill) to decrement, thereby reducing the problem as fast as possible.\n___\n# Approach\n- <!-- Describe your approach to solving the problem. -->Identify Largest Elements: Repeatedly identify the two largest amounts in the array since filling these two will reduce the problem fastest.\n- Sorting: Sort the amount array in descending order so that the two largest values are always at the end.\n- Decrement and Track Seconds: In each iteration, decrement the two largest values if they are non-zero, and increment the counter representing the time taken.\n___\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->O(n) where \'n\' is the sum of all elements in \'amount\'.\n___\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->O(1) since we are only using a fixed amount of extra space regardless of the input size.\n___\n# Code\n```csharp []\npublic class Solution {\n    public int FillCups(int[] amount) {\n        int seconds = 0;\n\n        // Sort until all values are 0\n        while (amount[0] != 0 || amount[1] != 0 || amount[2] != 0) {\n            Array.Sort(amount);\n            // Fill the two largest cups (amount[2] and amount[1])\n            if (amount[2] > 0) amount[2]--;\n            if (amount[1] > 0) amount[1]--;\n            seconds++;\n        }\n\n        return seconds;\n    }\n}\n\n//  Sorting: By sorting the amount array in each iteration, we ensure that we are always working with the two largest values, which helps minimize the number of seconds.\n//  Loop: The loop continues until all values are zero.\n//  Decrement: In each iteration, decrement the two largest values if they are greater than zero, and increment the seconds counter.\n```
['Array', 'Greedy', 'Sorting', 'C#']