Ericsson interview question

Explain how you managed to solve the task?