Bloomberg Interview Question

Dynamic programming question that was difficult