Generate a puzzle and its solution.
[puzzle,solution] = sudoku_generate2 ( difficulty )
the level of the puzzle, difficulty=1 is easy, difficulty=2 is medium, difficulty=3 is more difficult
the 9x9 puzzle matrix, with zeros for unknown entries
the 9x9 solution matrix without any zero
Generates a random sudoku. Then delete some entries according to the difficulty. Solves the puzzle and the transposed puzzle. If the two solutions are equal, the solution is probably unique: returns it. If not, continue to generate puzzles until unicity is achieved. This algorithm is slow (typically 40 seconds).