Question d’entretien chez Google

Dynamic programming question. But mostly everything was normal