I did not work out the 1st problem, first time!!
I did not work out the 1st problem, first time!! So Stupid!\n\nUpdate: 1 min after this end, I came up with this lol:\n\nExplanation: We can only care about the
I did not work out the 1st problem, first time!! So Stupid!\n\n**Update:** **1 min after this end, I came up with this lol:**\n\nExplanation: We can only care about the largest 2 elements in the array and try to fill them at one time, then dynamically find the largest 2 elements in the next loops, do the same thing until we fill all the cups. \n\n```\n    public int fillCups(int[] amount) {\n        Arrays.sort(amount);\n        int res = 0;\n        while (amount[2] != 0) {\n            res++;\n            amount[2]--;\n            if (amount[1] > 0) {\n                amount[1]--;\n            }\n            Arrays.sort(amount);\n        }\n        return res;\n    }\n```\n\n**Thanks your guys\' upvotes for making me less unhappy!**
[]