Question d’entretien chez Amazon

Greedy algorithm and the Palindrome sequence