TypeScript/JavaScript Dynamic Programming Solution
\nconst minScoreTriangulation = (values: number[]): number => {\n  const dp = new Array(values.length + 1)\n    .fill(0)\n    .map(() => new Array(values.length
```\nconst minScoreTriangulation = (values: number[]): number => {\n  const dp = new Array(values.length + 1)\n    .fill(0)\n    .map(() => new Array(values.length + 1).fill(null));\n\n  return minScoreTriangulationHelper(values, dp, 0, values.length - 1);\n};\n\nconst minScoreTriangulationHelper = (\n  values: number[],\n  dp: number[][],\n  row: number,\n  col: number\n): number => {\n  if (col - row <= 1) return 0;\n\n  if (dp[row][col] !== null) return dp[row][col];\n\n  dp[row][col] = Number.MAX_VALUE;\n\n  for (let i = row + 1; i < col; i++) {\n    dp[row][col] = Math.min(\n      dp[row][col],\n      minScoreTriangulationHelper(values, dp, row, i) +\n        values[row] * values[i] * values[col] +\n        minScoreTriangulationHelper(values, dp, i, col)\n    );\n  }\n\n  return dp[row][col];\n};\n```
['Dynamic Programming', 'TypeScript', 'JavaScript']