Infosys Interview Question

Normal coding