Google Interview Question

Dynamic programming