C++  ||  Memoization  ||  Tabulation
Memoization\n\nint solve(vector<int> &values, int i, int j, vector<vector<int>> &dp){\n        if(i+1==j){\n            return 0;\n        }\n        if(dp[i][j
Memoization\n```\nint solve(vector<int> &values, int i, int j, vector<vector<int>> &dp){\n        if(i+1==j){\n            return 0;\n        }\n        if(dp[i][j]!=-1){\n            return dp[i][j];\n        }\n        int ans=INT_MAX;\n        for(int k=i+1; k<j; k++){\n            ans = min(ans, (values[i]*values[j]*values[k])+solve(values, i, k, dp)+solve(values, k,j, dp));\n        }\n        return dp[i][j] = ans;\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, 0, n-1, dp);\n    }\n```\n\nTabulation\n```\nint minScoreTriangulation(vector<int>& values) {\n        int n = values.size();\n        vector<vector<int>> dp(n, vector<int>(n, 0));\n        for(int i=n-1; i>=0; i--){\n            for(int j=i+2; j<n; j++){\n                int ans = INT_MAX;\n                for(int k=i+1; k<j; k++){\n                    ans = min(ans, values[i]*values[j]*values[k] + dp[i][k] + dp[k][j]);\n                }\n                dp[i][j] = ans;\n            }\n        }\n        return dp[0][n-1];\n    }\n```
['Dynamic Programming', 'Recursion', 'Memoization', 'C']