LinkedIn interview question

Dynamic programming