c++, bottom-up DP , easy to understand
\nclass Solution {\npublic:\n    int minScoreTriangulation(vector<int>& A) {\n        int n = A.size();\n        vector<vector<int>> dp(n,vector<int>(n,-1));\n 
```\nclass Solution {\npublic:\n    int minScoreTriangulation(vector<int>& A) {\n        int n = A.size();\n        vector<vector<int>> dp(n,vector<int>(n,-1));\n        \n        for(int gap = 0; gap < n; gap++){\n            for(int i = 0,j=i+gap; i < n,j < n; i++,j++){\n                if(gap == 0 || gap == 1){\n                    dp[i][j] = 0;\n                }\n                else\n                {\n                    int ans = 1<<30;\n                    for(int k = i+1; k < j; k++){\n                        ans = min(ans,A[i]*A[k]*A[j] + dp[i][k] + dp[k][j]);\n                        \n                    dp[i][j] = ans;\n                    }\n                }\n              \n            }\n        }\n        \n        return dp[0][n-1];\n       \n    }\n};\n```
[]