Amazon interview question

I was asked question on dynamic programing