how dp[0][n-1] is the final answer to the problem
Matrix chain multiplication
Hey Aslesha!, this is because dp[i][j] represents optimal answer for multiplying matrices from index i to j(inclusive), hence for final answer we use dp[0][n-1].
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.