Infosys interview question

12 Ball Puzzle.