AfterAcademy Tech
Matrix Chain Multiplication
Given a chain <M1, M2...Mn> of n two-dimensional matrices, write a program to fully parenthesize the product M1×M2×⋯×Mn in a way that minimizes the number of multiplications. It's a famous dynamic programming problem.