Sudoko solver problem

why i am getting TLE https://ide.codingblocks.com/s/266433

Hey @Rishabhsharm,

Cross verify your code with the following:

Let me know if you still can’t find the mistake.
Hope, this would help.

in your code you used dynamic array rest of the code is same , can you please explain?

Hello @Rishabhsharm,

Mistakes in your code:
//end of row
if(j==n){
// sudokoSolver(mat,i+1,0,n);
return sudokoSolver(mat,i+1,0,n);
}
//skip the pre filled matrix
if(mat[i][j]!=0){
// sudokoSolver(mat,i,j+1,n);
return sudokoSolver(mat,i,j+1,n);
}

You have to return the result of these recursive calls.

Hope, this would help.