Matrix Chain Multiplication Cost

Given an array of dimensions dims representing matrix chain dimensions, where dims[i-1] and dims[i] are dimensions of matrix i, find the minimum number of scalar multiplications needed to multiply the chain of matrices.

Examples
Input: [10,30,5,60]
Output: 4500
Hints

Matrix Chain Multiplication Cost

Given an array of dimensions `dims` representing matrix chain dimensions, where dims[i-1] and dims[i] are dimensions of matrix i, find the minimum number of scalar multiplications needed to multiply the chain of matrices.