MCM Pattern | Little Variation | C++ Concise Solution
class Solution {\npublic:\n    \n    int helper(vector& values, int i,int j,vector>&dp)\n    {\n        // initialization \n        if(i>=j) return 0;\n        
class Solution {\npublic:\n    \n    int helper(vector<int>& values, int i,int j,vector<vector<int>>&dp)\n    {\n        // initialization \n        if(i>=j) return 0;\n        if(i+1==j) return 0; // when we cannot make a triange \n        // imagine the case when index paased are 0,1 or 2,3 and so on \n        \n        if(dp[i][j]!=-1) return dp[i][j];\n        \n        int mini=INT_MAX;\n        \n        for(int k=i+1;k<j;k++)\n        {\n            int tempAns = helper(values,i,k,dp) + helper(values,k,j,dp)+ (values[i]*values[k]*values[j]);\n            \n            mini=min(mini, tempAns);\n        }\n        dp[i][j]=mini;\n        return mini;\n    }\n    \n    int minScoreTriangulation(vector<int>& values) {\n        vector<vector<int>>dp(values.size()+1, vector<int>(values.size()+1, -1));\n        return helper(values,0,values.size()-1,dp);\n    }\n};
[]