C++ with Dynamic Programing
\n### 8 ms, faster than 81.81%\n### 7.9 MB, less than 99.32% \n\nclass Solution {\npublic:\n    //MCM memorization method\n    // assign  a matrix -1 initally\n
```\n### 8 ms, faster than 81.81%\n### 7.9 MB, less than 99.32% \n\nclass Solution {\npublic:\n    //MCM memorization method\n    // assign  a matrix -1 initally\n    //then we store value after check that t[i][j]!=-1\n   int t[50][51];\n    int solve(vector<int>& values,int i,int j ){\n        if(i>=j)return 0;\n        \n        if(t[i][j]!=-1)return t[i][j];\n        \n        int mn=INT_MAX;  \n        \n        for(int k=i;k<=j-1;k++){\n            \n            int temp=solve(values,i,k)+solve(values,k+1,j)+\n                        values[i-1]*values[k]*values[j];\n            mn=min(mn,temp);\n            \n        }\n        return t[i][j]=mn;\n    }\n    \n    int minScoreTriangulation(vector<int>& values) {\n        memset(t,-1,sizeof(t));\n        return solve(values,1,values.size()-1);\n    }\n};\n```
['Dynamic Programming', 'Memoization', 'C']