Infosys Interview Question

No difficulty.