c++ || DP || memoization
\nclass Solution {\npublic:\n    int dp[60][60];\n    int mcm(vector<int>&v,int i,int j)\n    {\n        if(dp[i][j]!=-1)\n            return dp[i][j];\n       
```\nclass Solution {\npublic:\n    int dp[60][60];\n    int mcm(vector<int>&v,int i,int j)\n    {\n        if(dp[i][j]!=-1)\n            return dp[i][j];\n        int ans=INT_MAX;\n        for(int k=i+1;k<j;k++)\n        {\n            int temp=v[i]*v[k]*v[j]+mcm(v,i,k)+mcm(v,k,j);\n            // cout<<temp<<"  " << i << "  " << j << endl;\n            if(ans>temp)\n                ans=temp;\n        }\n        if(ans==INT_MAX)\n            return dp[i][j]= 0;\n        return dp[i][j]= ans;\n    }\n    \n    int minScoreTriangulation(vector<int>& values) {\n        memset(dp,-1,sizeof dp);\n        return mcm(values,0,values.size()-1);\n        \n    }\n};\n```
['Dynamic Programming', 'Memoization']