Infosys Interview Question

An easy coding problem