Pregunta de entrevista de Apple

Use Join to solve question