JAVA most easiest solution for beginners
\'\'\'\nclass Solution {\n    public int fillCups(int[] amount) {\n       int count=0;\n       while(amount[0]>0||amount[1]>0||amount[2]>0)\n       {\n         
\'\'\'\nclass Solution {\n    public int fillCups(int[] amount) {\n       int count=0;\n       while(amount[0]>0||amount[1]>0||amount[2]>0)\n       {\n           if(amount[0]==0&&amount[1]==0)\n               return count+amount[2];\n           \n           else if(amount[0]==0&&amount[2]==0)\n               return count+amount[1];\n           \n           else if(amount[1]==0&&amount[2]==0)\n               return count+amount[0];\n           else if(amount[0]==0)\n           {\n               amount[1]-=1;\n               amount[2]-=1;\n               count++;\n           }\n           else if(amount[1]==0)\n           {\n               \n               amount[0]-=1;\n               amount[2]-=1;\n               count++;\n           }\n           else if(amount[2]==0)\n           {\n               \n               amount[1]-=1;\n               amount[0]-=1;\n               count++;\n           }\n           else \n           {\n               int i=maximum(amount);\n               int j=max2(amount);\n               amount[i]-=1;\n               amount[j]-=1;\n               count++;\n           }\n       }\n        return count;\n    }\n    public int maximum(int[]array)\n    {\n        if(array[0]>=array[1] && array[0]>=array[2])\n            return 0;\n\n        else if(array[1]>=array[0] && array[1]>=array[2])\n            return 1;\n\n        else if(array[2]>=array[0] && array[2]>=array[1])\n            return 2;\n        return 0;\n\n    }\n    public int max2(int[]array)\n    {\n        if(array[0]>array[1] && array[0]>array[2])\n        {\n            if(array[1]>array[2])\n                return 1;\n            else return 2;\n        }\n        else if(array[1]>array[0] && array[1]>array[2])\n        {\n            if(array[0]>array[2])\n                return 0;\n            else return 2;\n        }\n        else \n        {\n            if(array[0]>array[1])\n                return 0;\n            else return 1;\n        }\n    }\n}\n\'\'\'
[]