C++, simple, priority queue
Code\n\n// To minimize time, choose the two largest value and decrease it by 1.\n// Repeat this until all elements become zero.\nclass Solution {\npublic:\n    
# Code\n```\n// To minimize time, choose the two largest value and decrease it by 1.\n// Repeat this until all elements become zero.\nclass Solution {\npublic:\n    int fillCups(vector<int>& amount) {\n        priority_queue<int> pq(amount.begin(), amount.end()); \n    \n        int time = 0;\n        while (pq.top() > 0) {\n            int num1 = pq.top(); pq.pop();\n            int num2 = pq.top(); pq.pop();\n            num1--;\n            num2--;\n            pq.push(num1);\n            pq.push(num2);\n            time++;\n        }\n    \n        return time;\n    }\n};\n```
['Array', 'Greedy', 'Sorting', 'Heap (Priority Queue)', 'C++']