Simple Math O(1) solution
It is so obvious that of max element is greater than sum of other 2 elements then it would take max element seconds. for eg 5,21, here 5>2+1, so 3 cups out of 5
* It is so obvious that of max element is greater than sum of other 2 elements then it would take max element seconds. for eg 5,21, here 5>2+1, so 3 cups out of 5 cups will get filled with other 2 sets in 3 second and remaining 2 will take 2 seconds.\n* Now for the second case, 5,4,4. the answer will be (5+4+4)/2 +1=7. here is the explanation we are cosidering 2 cups at a time, because 2 cups will take 1 seconds and hence n cups will take n/2 seconds to get filled if n is odd it will take one extra second to fill it.\n* hope its understandable\n* below is the code !\n\n\n```\nclass Solution {\npublic:\n    int fillCups(vector<int>& amount) {\n        int a=amount[0],b=amount[1],c=amount[2];\n        int d=max(a,max(b,c));\n        if(2*d>a+b+c) return d;\n        if((a+b+c)%2==0) return (a+b+c)/2;\n        return (a+b+c)/2 +1;\n    }\n};\n```
[]