Pregunta de entrevista de La Cigogne Française

A little problem-solving question about an array