Microsoft Interview Question

Dynamic programming problem, or maybe it was greedy