Pregunta de entrevista de phData

a question about reducing 2 for loops to 1