EASY | C++ | Matrix Chain Multiplication | Memoization | Aditya Verma Solution
Kindly Upvote if you find this useful\n\nThis question is smiliar to Matrix Chain Multiplication\n\nclass Solution {\npublic:\n    int dp[1002][1002];\n    int 
**Kindly Upvote if you find this useful**\n\nThis question is smiliar to Matrix Chain Multiplication\n```\nclass Solution {\npublic:\n    int dp[1002][1002];\n    int solve(vector<int> arr, int i,int  j){\n        if(i>=j) return 0;\n        \n        if(dp[i][j]!=-1) return dp[i][j];\n        \n        int ans = INT_MAX;\n        for(int k=i;k<j;k++){\n            \n            int temp = solve(arr,i,k) + solve(arr,k+1,j) + (arr[i-1] * arr[k] * arr[j]);\n            ans = min(ans,temp);\n        }\n        return dp[i][j] = ans;\n    }\n    int minScoreTriangulation(vector<int>& values) {\n        memset(dp,-1,sizeof(dp));\n        return solve(values,1,values.size()-1);\n    }\n};\n```\n**Kindly Upvote if you find this useful**
[]