C++||DP||MCM-Pattern||Easy&Understandale
\nclass Solution {\npublic:\n    int solve(vector<int>&values,int i,int j,vector<vector<int>>&dp){\n        if(i>=j)\n            return 0;\n        if(dp[i][j]
```\nclass Solution {\npublic:\n    int solve(vector<int>&values,int i,int j,vector<vector<int>>&dp){\n        if(i>=j)\n            return 0;\n        if(dp[i][j]!=-1){\n            return dp[i][j];\n        } \n        int minm = INT_MAX;\n        \n        for(int k=i;k<j;k++){\n            int left = (dp[i][k]!=-1)? dp[i][k] : solve(values,i,k,dp);\n            int right = (dp[k+1][j]!=-1)? dp[k+1][j] : solve(values,k+1,j,dp);\n            int temp = left + right + values[i-1]*values[k]*values[j];\n            minm = min(minm,temp);\n        }\n      return dp[i][j] = minm;  \n    }\n    int minScoreTriangulation(vector<int>& values) {\n        int n = values.size();\n        vector<vector<int>> dp(n+1,vector<int>(n+1,-1));\n        return solve(values,1,n-1,dp);     \n    }\n};\n```
['Dynamic Programming', 'C']