[Java] Memoization (Top Down)
\n\tpublic static int minScoreTriangulation(int[] arr) {\n        int len = arr.length;\n        int[][] lookup = new int[len][len];\n        return minScoreFro
```\n\tpublic static int minScoreTriangulation(int[] arr) {\n        int len = arr.length;\n        int[][] lookup = new int[len][len];\n        return minScoreFromTo(arr, 0, len - 1, lookup);\n    }\n\n    private static int minScoreFromTo(int[] arr, int from, int to, int[][] lookup) {\n        if (from >= to || from + 1 == to) {\n            return 0;\n        } else {\n            if (lookup[from][to] > 0) {\n                return lookup[from][to];\n            }\n        }\n\n        int min = Integer.MAX_VALUE;\n\n        for (int mid = from + 1; mid < to; mid++) {\n            min = Math.min(min, arr[mid]*arr[from]*arr[to]\n                    + minScoreFromTo(arr, from, mid, lookup) + minScoreFromTo(arr, mid, to, lookup));\n        }\n\n        lookup[from][to] = min;\n\n        return min;\n    }\n```
[]