Java O(1)
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \nWe have to fill 2 cup a
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nWe have to fill 2 cup at the same time so if our max cap 2 times bigger than sum we have to take it otherwise we have to remove cups 2 by 2 \n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n$$O(1)$$because only 3 cup\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n$$O(1)$$because only 3 cup\n# Code\n```\nclass Solution {\n     public int fillCups(int[] amount) {\n        int maxCup = 0, sum = 0;\n        for(int curCup: amount) {\n            maxCup = Math.max(curCup, maxCup);\n            sum += curCup;\n        }\n        return Math.max(maxCup, (sum + 1) / 2);\n    }\n}\n```
['Java']