you convex nside polygon vertex integer value you give integer array value valuesi value ith vertex ie clockwise orderyou triangulate polygon n 2 triangle for triangle value triangle product value vertice total score triangulation sum value n 2 triangle triangulationreturn small possible total score achieve triangulation polygon example 1input value 123output 6explanation the polygon triangulate score triangle 6example 2input value 3745output 144explanation there triangulation possible score 375 457 245 345 347 144the minimum score 144example 3input value 131415output 13explanation the minimum score triangulation score 113 114 115 111 13 Constraintsn valueslength3 n 501 valuesi 100