Infosys interview question

Not much difficult