Question d’entretien chez IBM

Dynamic programming related coding question.