LinkedIn interview question

Dynamic programming question, don't remember the details