Pregunta de entrevista de Blocket

Can you explain your solution of the test assignment?