[Accepted] Swift
\nclass Solution {\n    func fillCups(_ amount: [Int]) -> Int {\n        \n        var am = amount\n        var res = 0\n        \n        while am.reduce(0, +)
```\nclass Solution {\n    func fillCups(_ amount: [Int]) -> Int {\n        \n        var am = amount\n        var res = 0\n        \n        while am.reduce(0, +) > 0 {\n            am = am.sorted()\n            am[1] = max(0, am[1] - 1)\n            am[2] = max(0, am[2] - 1)\n            res += 1\n        }\n        \n        return res\n    }\n}\n```
['Swift']