Infosys interview question

Coding question simply asked to solve