Python Max Heap Simple Solution
Complexity\n- Time complexity: O(k * logn)\n\n- Space complexity: O(n)\n\n# Code\n\nclass Solution:\n    def fillCups(self, amount: List[int]) -> int:\n        
# Complexity\n- Time complexity: $$O(k * logn)$$\n\n- Space complexity: $$O(n)$$\n\n# Code\n```\nclass Solution:\n    def fillCups(self, amount: List[int]) -> int:\n        amount = [-a for a in amount]\n        heapq.heapify(amount)\n        res = 0\n        while True:\n            first = heapq.heappop(amount)\n            second = heapq.heappop(amount)\n            if not first and not second:\n                break\n            heapq.heappush(amount, first+1) if first else heapq.heappush(amount, first)\n            heapq.heappush(amount, second+1) if second else heapq.heappush(amount, second)\n            res += 1\n        return res\n```
['Heap (Priority Queue)', 'Python3']