HCLTech Interview Question

No difficulty