Question d’entretien chez Amazon

easy-medium leetcode question with help oft he interviewer