Minimum Amount of Time to Fill Cups LeetCode solution in Python

1
# Runtime: 42 ms (Top 62.11%) | Memory: 13.9 MB (Top 56.09%)
2
class Solution:
3
def fillCups(self, amount: List[int]) -> int:
4

5
count = 0
6
amount = sorted(amount, reverse=True)
7
while amount[0] > 0:
8
amount[0] -= 1
9
amount[1] -= 1
10
count += 1
11
amount = sorted(amount, reverse=True)
12
return count

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0