diff --git a/Solutions/37SudokuSolver.cpp b/Solutions/37SudokuSolver.cpp new file mode 100644 index 0000000..624c401 --- /dev/null +++ b/Solutions/37SudokuSolver.cpp @@ -0,0 +1,46 @@ +class Solution { +private: + bool helpmeValid(vector>& board, int row, int col, char x) + { + for(int i=0;i<9;i++) + { + if (board[i][col] == x) return false; + if (board[row][i] == x) return false; + + //formula: + if (board[3 * (row/3) + i/3][3 * (col/3) + i%3] == x) return false; + } + return true; + } + + + bool helpme(vector>& board) + { + for (int i=0;i>& board) + { + helpme(board); + } +};