Question d’entretien chez Amazon

Some array question (leetcode medium difficulty)