Dynamic Programming

I am not able to solve this problem.sharing the link…