Java Brute-Force Solution using Sorting
The observation is that we can get the minimum time needed if we always start with the maximum number of cups.\n- Since the array has a length of 3, I figure we
- The observation is that we can get the minimum time needed if we always start with the maximum number of cups.\n- Since the array has a length of 3, I figure we can just sort it everytime.\n```\nclass Solution {\n    public int fillCups(int[] amount) {\n        int cnt = 0;\n        Arrays.sort(amount);\n        while(amount[2] != 0){\n            cnt++;\n            amount[2] -= 1;\n            amount[1] -= 1;\n            Arrays.sort(amount);\n        }\n        return cnt;\n    }\n}\n```
['Java']