Infosys Interview Question

Asked a Puzzle to solve, it was a real time problem.