Amazon interview question

I had a dynamic programming problem that was not too hard