Bloomreach Interview Question

Dynamic programming question