Google Interview Question

As much as I recall it is a Dynamic Programming question.