Domanda di colloquio di Ericsson

Explain how you managed to solve the task?