Infosys interview question

was given puzzle to solve