C++ Solution || priority queue || easy-understanding
\n\n  int fillCups(vector<int>& amount) {\n        priority_queue<int> pq;   //  max heap\n        \n        for(auto amt: amount)\n            pq.push(amt);\n 
\n```\n  int fillCups(vector<int>& amount) {\n        priority_queue<int> pq;   //  max heap\n        \n        for(auto amt: amount)\n            pq.push(amt);\n        \n        \n        int count=0;\n        while(!pq.empty())\n        {\n            if(pq.top()==0) break;   // if all bottles are filled\n            if(pq.size()==1)         // if only one bottle is left , fill it in one by one time, so add the needed time to count\n            {\n               count+= pq.top();\n               break;\n            }\n            int hot= pq.top();    // maxm cap\n            pq.pop();\n            int warm = pq.top();  // 2nd max cap\n            pq.pop();\n            \n            \n            count++;         //pourred both max n 2nd max , so increse counter\n            if(hot>1) pq.push(--hot);     // if left amt is less then 0 , then we have alreday filled that cup\n            if(warm>1)pq.push(--warm);    // so wont add to the queue\n         \n                \n            \n                \n        }\n        return count;\n    }\n```
['Heap (Priority Queue)', 'C++']