#1039

Minimum Score Triangulation of Polygon

specialist · 610 · lc medium +29 · 67.4% accepted · 2,319 likes · top 74%

Description

You have a convex polygon with n vertices, each with an integer value given in values (clockwise order). Triangulating the polygon produces n - 2 triangles. Each triangle's weight is the product of its three vertex values.

Return the minimum total weight across all possible triangulations.

Code

1
2
3