Minimum Score Triangulation of Polygon
Solve this the way you would in the interview: out loud, on a timer, with an AI interviewer asking follow-ups while you code. You get a scored report at the end.
Practice this as a mock interviewFree to start, no account neededProblem
A convex polygon has n vertices labeled with positive integers values[0..n-1] in clockwise order.
Triangulate the polygon into n - 2 triangles using non-crossing diagonals. Each triangle scores the **product** of its three vertex labels, and a triangulation's total score is the sum over all its triangles.
Return the smallest total score over all possible triangulations.
Examples
Constraints
- `3 <= n <= 50`
- `1 <= values[i] <= 100`
What the interviewer grades
A correct solution is one of five scores. The report also grades problem understanding (did you clarify inputs and edge cases before coding), problem solving, communication while you work, code quality, and testing. See a sample report, or read up on the pattern in the lessons.