Clean and concise MCM code || Recursion + Memorization || C++
\nclass Solution {\nprivate:\n    int solve(int st,int en,vector<int> &arr,vector<vector<int>> &dp){\n        if(st+1 == en) return 0;\n        if(dp[st][en] !=
```\nclass Solution {\nprivate:\n    int solve(int st,int en,vector<int> &arr,vector<vector<int>> &dp){\n        if(st+1 == en) return 0;\n        if(dp[st][en] != -1) return dp[st][en];\n        \n        int ans = 1e9;\n        \n        for(int cut=st+1;cut<en;cut++){\n            int left = solve(st,cut,arr,dp);\n            int right = solve(cut,en,arr,dp);\n            int curr = arr[st] * arr[cut] * arr[en];\n            \n            int curr_res = left + curr + right;\n            \n            ans = min(ans,curr_res);\n        }\n        \n        return dp[st][en] = ans;\n    }\npublic:\n    int minScoreTriangulation(vector<int>& values) {\n        int n = values.size();\n        vector<vector<int>> dp(n,vector<int> (n,-1));\n        return solve(0,n-1,values,dp);\n    }\n};\n```
['Recursion', 'Memoization', 'C', 'C++']