Microsoft interview question

Dynamic programming problem, or maybe it was greedy