TLE
ABORTING COMMAND
TLE
ABORTING COMMAND
hello @mverma_be19 the error was that you have to write these lines
bool nextqueen=solveNqueen(board,i+1,n);
if(nextqueen)
{
return true;
}
//If not true means (i,j) is not the right position-Assumption is wrong
board[i][j]=0; //BACKTRACK
only when if it is possible .
corrected code is https://ide.codingblocks.com/s/340041
if you still have any doubt you can ask here.
if you feel your doubt is cleared please mark the doubt as resolved .
Happy Learning !!
@mverma_be19 you have not read what i have wriiten above .
i said that you have to write these lines only when if it is possible to place the present queen properly otherwise not .
please check the code link which i gave you above .
again i have shared the corrected code with you .
please see your mistake here.