Infosys interview question

Normal coding