LinkedIn Interview Question

Dynamic programming question, don't remember the details