Sudoku solver problem

import java.util.;
import java.lang.
;
import java.io.*;
class GFG
{
public static void main (String[] args)
{
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
while(t–>0){
int mat[][]=new int[9][9];
for(int i=0;i<9;i++){
for(int j=0;j<9;j++){
mat[i][j]=sc.nextInt();
}
}
solve(mat,0,0,9);
System.out.println();
}
}
static boolean solve(int mat[][],int i,int j,int n){
if(i==n){
for(int row=0;row<n;row++){
for(int col=0;col<n;col++){
System.out.print(mat[row][col]+" ");
}
System.out.println();
}
return true;
}
if(j==n){
return solve(mat,i+1,0,n);
}
if(mat[i][j]!=0){
return solve(mat,i,j+1,0);
}
for(int number=1;number<=9;number++){
if(canplace(mat,i,j,n,number)){
mat[i][j]=number;
boolean rest=solve(mat,i,j+1,n);
if(rest){
return true;
}
}
}
mat[i][j]=0;
return false;
}
static boolean canplace(int mat[][],int i,int j,int n,int number){
for(int c=0;c<n;c++){
if(mat[i][c]==number || mat[c][j]==number){
return false;
}
}
int rn=3;
int sx=(i/rn)*rn;
int sy=(j/rn)*rn;
for(int row=sx;row<sx+rn;row++){
for(int col=sy;col<sy+rn;col++){
if(mat[row][col]==number){
return false;
}
}
}
return true;
}
}

this is not producing any output

can you plzz tell me…where i m wrog?

@Affan-Mokarram-202031887744398
Please send your code on CB IDE.
As you can see it is not in readable shape right now

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.