Question d’entretien chez Amazon

A dynamic programming question rated "hard" on leetcode.