Question d’entretien chez Amazon

DSA question based on array