Pregunta de entrevista de Alignable

They asked a simple technical question involving traversing an array