Matrix Chain Multiplication || Easy || C++ || Memoization
\nclass Solution {\npublic:\n    \n    int dp[51][51];\n    \n    int solve(vector<int>&values, int i, int j)\n    {\n        if(i>=j)\n            return 0;\n 
```\nclass Solution {\npublic:\n    \n    int dp[51][51];\n    \n    int solve(vector<int>&values, int i, int j)\n    {\n        if(i>=j)\n            return 0;\n        if(dp[i][j]!=-1)\n            return dp[i][j];\n        \n        int ans = 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) + values[i-1]*values[j]*values[k];\n                \n            ans = min(ans,temp);\n        }\n        dp[i][j] = ans;\n        return dp[i][j];\n    }\n    \n    int minScoreTriangulation(vector<int>& values) {\n        \n        int n = values.size();\n        \n        int i = 1;\n        int j = n-1;\n        memset(dp,-1,sizeof(dp));\n        return solve(values,i,j);\n        \n    }\n};\n```
['Dynamic Programming', 'Memoization', 'C', 'C++']