Solving A Classic Google Interview Logic Puzzle