Clever Devices Interview Question

already explained in the above section