Question d’entretien chez Amazon

asked on leetcode no between 39