Question d’entretien chez Google

coding question was asked..simple one using for loop