Question d’entretien chez Amazon

Coding question was a leetcode hard question