Pregunta de entrevista de Meta

It was a fairly common array problem