My DP Solution || No Maths || Brute force approach || Memoised || Overkill
Intuition\n Describe your first thoughts on how to solve this problem. \nWe have 6 choices that we can make, each recursive call takes that choice and returns t
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nWe have 6 choices that we can make, each recursive call takes that choice and returns the minimum number of seconds that it would take to get the cups filled from there.\n\nif any choice taken results in invalid quantity in any cup, which is negative quantity then we return a large value so that it wouldnt be considered in the minimum count.\n\nAs 3 independent states are being changed, we have used a 3D Matrix for the memoisation.\n\n# Complexity\n\nThe time complexity of the code without any memoisation would be \n$$O(6^n)$$ where $$ n = max(cold,warm,hot) $$\n\nAfter the memoisation the time complexity reduces greatly to $$O(cold*warm*hot)$$\n\n\n# Code\n```\nclass Solution {\npublic:\n    int helper(int cold, int warm, int hot, vector<vector<vector<int>>>& dp){\n        if(cold<0 || warm<0 || hot<0){\n            return INT_MAX-1000;\n        }\n        if(cold==0 && warm==0 && hot==0){\n            return 0;\n        }\n        if(dp[cold][warm][hot] != -1){\n            return dp[cold][warm][hot];\n        }\n\n        int res1 = 1+helper(cold-1,warm-1,hot,dp);\n        int res2 = 1+helper(cold-1,warm,hot-1,dp);\n        int res3 = 1+helper(cold,warm-1,hot-1,dp);\n        int res4 = 1+helper(cold-1,warm,hot,dp);\n        int res5 = 1+helper(cold,warm-1,hot,dp);\n        int res6 = 1+helper(cold,warm,hot-1,dp);\n\n        return dp[cold][warm][hot]=min({res1,res2,res3,res4,res5,res6});\n    }\n    int fillCups(vector<int>& amount) {\n        vector<vector<vector<int>>> dp(amount[0]+1, vector<vector<int>>(amount[1]+1, vector<int>(amount[2]+1, -1)));\n        return helper(amount[0],amount[1],amount[2],dp);\n    }\n};\n\n```
['Dynamic Programming', 'Memoization', 'C++']