Java DP
\nclass Solution {\n    public int minScoreTriangulation(int[] A) {\n        int[][] dp = new int[A.length][A.length];\n        \n        for(int g = 0; g < dp.
```\nclass Solution {\n    public int minScoreTriangulation(int[] A) {\n        int[][] dp = new int[A.length][A.length];\n        \n        for(int g = 0; g < dp.length; g++){\n            for(int i = 0,j = g; j < dp[0].length; i++,j++){\n                if(g == 0){\n                    dp[i][j] = 0; // trivial case as no triangle can be formed by 1 points\n                }else if(g == 1){\n                    dp[i][j] = 0; // Same trivial\n                }else if(g == 2){\n                    dp[i][j] = A[i]*A[i+1]*A[i+2]; // Also Trivial as we only have 3 points\n                }else{\n                    int min = Integer.MAX_VALUE;\n                    for(int k = i+1; k < j; k++){\n                        int tri = A[i]*A[j]*A[k]; // calclating triangle\n                        int left = dp[i][k]; // calculating left part\n                        int right = dp[k][j]; // calculating right part\n                        \n                        int total = tri + left + right;\n                        if(total < min){\n                            min = total;\n                        }\n                    }\n                    dp[i][j] = min;\n                }\n            }\n        }\n        \n        return dp[0][A.length - 1];\n    }\n}\n```
['Dynamic Programming', 'Java']