2412. Minimum Amount of Time to Fill Cups
My accepted Python solution to LeetCode problem 2412, Minimum Amount of Time to Fill Cups, running in 0ms.
- Difficulty: Easy
- Python
- Runtime 0ms
- Memory 17.2MB
- Updated
Read the problem on LeetCode View on GitHub
The problem statement is LeetCode’s and stays on their site. What follows is my accepted solution.
Python
Accepted on LeetCode — runtime 0ms, memory 17.2MB, accepted 2025-12-29.
class Solution:
def fillCups(self, amount: List[int]) -> int:
amount.sort()
# If the largest is >= sum of other two, answer is the largest
if amount[2] >= amount[0] + amount[1]:
return amount[2]
# Otherwise, we can pair them optimally
return (sum(amount) + 1) // 2