clean and easy c++ solution || 4ms runtime
\nclass Solution {\npublic:\n    int minScoreTriangulation(vector<int>& arr) {\n    int n = arr.size();\n    int dp[n-1][n-1];\n    for(int g = 0; g < n-1; g++)
```\nclass Solution {\npublic:\n    int minScoreTriangulation(vector<int>& arr) {\n    int n = arr.size();\n    int dp[n-1][n-1];\n    for(int g = 0; g < n-1; g++)\n    {\n       for(int i=0, j = g; j<n-1; i++, j++)\n       {\n           if(g == 0)\n           dp[i][j] = 0;\n           else if(g == 1)\n           dp[i][j] = arr[i]*arr[j]*arr[j+1];\n           else\n           {\n             int mincost = INT_MAX;\n             for(int k = i; k<j; k++)\n             {\n                 int lc = dp[i][k];\n                 int rc = dp[k+1][j];\n                 int mc = arr[i]*arr[k+1]*arr[j+1];\n                 int tc = lc + rc + mc;\n                 mincost = min(tc, mincost);\n             } \n             dp[i][j] = mincost; \n           }\n       }\n    }\n    return dp[0][n-2]; \n    }\n};\n```
['Dynamic Programming', 'C']