Ericsson Interview Question

Explain how you managed to solve the task?