C++ Easy Solution Two Approaches || Constant space and Heap
Approach 1 ---> Priority Queue\n\nclass Solution {\npublic:\n    int fillCups(vector<int>& arr) {\n        int count=0;        \n        priority_queue<int>pq(a
**Approach 1 ---> Priority Queue**\n```\nclass Solution {\npublic:\n    int fillCups(vector<int>& arr) {\n        int count=0;        \n        priority_queue<int>pq(arr.begin(),arr.end());\n        while(pq.top()!=0){\n            int t1=pq.top();\n            pq.pop();\n            int t2=pq.top();\n            pq.pop();\n            pq.push(t1-1);\n            pq.push(t2-1);\n            count++;\n        }\n        return count;\n    }\n};\n```\n\n**Approach 2 --> Constant Space**\n\n```\nclass Solution {\npublic:\n    int fillCups(vector<int>& arr) {\n        sort(arr.begin(),arr.end()); \n      int x=arr[0], y=arr[1],z=arr[2]; \n      int sum=x+y+z; \n      if(x+y>z)return sum/2+sum%2; \n      if(x==0 && y==0)return z; \n      else  return z; \n    } \n    \n};\n```
['C', 'Heap (Priority Queue)', 'C++']