# 2335. Minimum Amount of Time to Fill Cups https://leetcode.com/problems/minimum-amount-of-time-to-fill-cups/ ## brain teaser [ https://leetcode.com/problems/minimum-amount-of-time-to-fill-cups/discuss/2261394/JavaC%2B%2BPython-max(max(A)-(sum(A)-%2B-1)-2)](https://leetcode.com/problems/minimum-amount-of-time-to-fill-cups/discuss/2261394/JavaC%2B%2BPython-max(max(A)-(sum(A)-%2B-1)-2)) ## mine, greedy ```python= class Solution: def fillCups(self, amount: List[int]) -> int: ans=0 while sum(amount) > 0: amount.sort() if amount[1]-1>=0: amount[1]-=1 amount[2]-=1 else: amount[2]-=1 ans+=1 return ans ```