Pergunta de entrevista da empresa PIMCO

A question about arrays and manipulating it.