A Beginner Friendly Java Solution
A solution for complete beginners...\nPlease upvote if it helps!\n\n# Code\n\nclass Solution {\n    public int fillCups(int[] arr) {\n        PriorityQueue<Inte
A solution for complete beginners...\nPlease upvote if it helps!\n\n# Code\n```\nclass Solution {\n    public int fillCups(int[] arr) {\n        PriorityQueue<Integer> max = new PriorityQueue<>(Collections.reverseOrder());\n\n        for(int i : arr) max.add(i);\n\n        int count = 0;\n        while(max.peek() > 0) {\n            int num1 = max.poll();\n            int num2 = max.poll();\n            max.add(--num1);\n            max.add(--num2);\n            count++;\n        }\n        \n        return count;\n    }\n}\n```
['Array', 'Greedy', 'Heap (Priority Queue)', 'Java']