Question d’entretien chez Google

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