Matrix Chain Multiplication using Dynamic Programming