Question d’entretien chez Amazon

Easy alghoritmic programming question to solve