Google interview question

Dynamic Programming