Pregunta de entrevista de Ericsson

Explain how you managed to solve the task?