Pregunta de entrevista de Jet

a algorithm question related to array