c++ | easy | short
\n\n# Code\n\nclass Solution {\npublic:\n   int minScoreTriangulation(vector<int>& A) {\n        int n = A.size();\n        vector<vector<int>> dp(n, vector<int
\n\n# Code\n```\nclass Solution {\npublic:\n   int minScoreTriangulation(vector<int>& A) {\n        int n = A.size();\n        vector<vector<int>> dp(n, vector<int>(n));\n        for (int j = 2; j < n; ++j) {\n            for (int i = j - 2; i >= 0; --i) {\n                dp[i][j] = INT_MAX;\n                for (int k = i + 1; k < j; ++k)\n                    dp[i][j] = min(dp[i][j], dp[i][k] + dp[k][j] + A[i] * A[j] * A[k]);\n            }\n        }\n        return dp[0][n - 1];\n    }\n};\n```
['C++']