private static bool RecursiveSolve(SudokuPuzzle sudoku, int row, int column, ref int count, bool findMultiple = false) { if (sudoku[row, column] != 0) { return(SudokuSolver.RecursiveSolveNextNumber(sudoku, row, column, ref count, findMultiple)); } List <int> possible = new List <int>(); for (int i = 1; i <= sudoku.Size; i++) { if (!(sudoku.RowContains(row, i) || sudoku.ColumnContains(column, i) || sudoku.BlockContains(row, column, i))) { possible.Add(i); } } SudokuSolver.ShuffleNumbers(possible); while (possible.Count > 0) { sudoku[row, column] = possible[0]; bool solvable = SudokuSolver.RecursiveSolveNextNumber(sudoku, row, column, ref count, findMultiple); if (solvable) { if (!findMultiple || count > 1) { return(true); } } possible.RemoveAt(0); } sudoku[row, column] = 0; return(false); }