Google interview question

Dynamic programming