Minimum Score Triangulation of Polygon

You have a convex n-sided polygon where each vertex has an integer value. These values are given in an integer array values, where values[i] is the value of the ith vertex.

The score of a triangulation is the sum of the scores of all its triangles. The score of a triangle is the product of the values of its three vertices.

Return the minimum score of a triangulation of the given polygon.

Examples
Input: [1,2,3]
Output: 6
Hints

Minimum Score Triangulation of Polygon

You have a convex `n`-sided polygon where each vertex has an integer value. These values are given in an integer array `values`, where `values[i]` is the value of the `i`th vertex.