Amazon interview question

I had a dynamic programming question