diff --git a/N Queens b/N Queens new file mode 100644 index 0000000..e12f124 --- /dev/null +++ b/N Queens @@ -0,0 +1,79 @@ +#include +using namespace std; + +bool isQueenSafe(int chess[][10], int row, int col,int n){ + //checking col + for(int i=0;i=0 && y>=0) + { + if(chess[x][y]==1){ + return false;} + x--; + y--; + } + //right diagonal + x=row; + y=col; + while(x>=0 && y>n; +int chess[10][10]={0}; + printNQueens(chess,0,n); + }