Question d’entretien chez Amazon

Array related problem. easily found in previous question papers.