Question d’entretien chez Amazon

Some dynamic programming on words.