Question d’entretien chez Google

it was Dynamic Programming question