Java memoization DP solution
\nclass Solution {\n    public int minScoreTriangulation(int[] A) {\n        return dfs(A, 0, A.length - 1, new Integer[A.length][A.length]);\n    }\n    \n    
```\nclass Solution {\n    public int minScoreTriangulation(int[] A) {\n        return dfs(A, 0, A.length - 1, new Integer[A.length][A.length]);\n    }\n    \n    int dfs(int[] A, int i, int j, Integer[][] memo) {\n        if (j < i + 2) return 0;  // base case: you can\'t form a triangle with less than 3 points\n        \n        if (memo[i][j] != null) return memo[i][j];\n        \n        int res = Integer.MAX_VALUE;\n        for (int k = i + 1; k < j; ++k) {\n            res = Math.min(res, dfs(A, i, k, memo) + dfs(A, k, j, memo) + A[i] * A[k] * A[j]);\n        }\n        \n        memo[i][j] = res;\n        return memo[i][j];\n    }\n}\n```\n\nBottom up DP: \n```\nclass Solution {\n    public int minScoreTriangulation(int[] A) {\n        int[][] dp = new int[A.length][A.length];\n        \n        for (int i = A.length - 1; i >= 0; --i) {\n            for (int j = i+2; j < A.length; ++j) {\n                dp[i][j] = Integer.MAX_VALUE;\n                for (int k = i + 1; k < j; ++k) {\n                    dp[i][j] = Math.min(dp[i][j], dp[i][k] + dp[k][j] + A[i] * A[k] * A[j]);\n                }\n            }\n        }\n        \n        return dp[0][A.length - 1];\n    }\n}\n```
[]