Question d’entretien chez LinkedIn

It is a basic Dynamic Programming question.