# Matrix Chain Multiplication

Let's solve the Matrix Chain Multiplication problem using Dynamic Programming.

## Statement

You are given a chain of matrices to be multiplied. You have to find the least number of primitive multiplications needed to evaluate the result.

Note:Given two matrices $A$ and $B$ of dimensions $(n \times m)$ and $(m \times l)$, the resulting matrix we get is $AB$, whose dimensions are $(n \times l)$. Further, when multiplying these two matrices, the number of primitive multiplications is $(n \times m \times l)$.

Level up your interview prep. Join Educative to access 80+ hands-on prep courses.