diff --git a/Sudoku.cpp b/Sudoku.cpp new file mode 100644 index 0000000..e189877 --- /dev/null +++ b/Sudoku.cpp @@ -0,0 +1,95 @@ +#include +#include +using namespace std; + +bool isSafe(int mat[][9],int i,int j,int no){ + + + //Check for row and col + for(int k=0;k<9;k++){ + if(mat[k][j]==no||mat[i][k]==no){ + return false; + } + } + //check for subgrid + + int sx = (i/3)*3; + int sy = (j/3)*3; + + for(int x=sx; x