Pregunta de entrevista de Meta

Solve problem with one side chained array