Amazon interview question

A coding questions about Dynamic programming