Infosys Interview Question

Important question they have asked is one puzzle