Infosys interview question

dsa