Microsoft interview question

Dynamic Programming