Whats wrong in this sudoko solver problem ? my one test case is failing

#include <bits/stdc++.h>
using namespace std;
bool canplace(int arr[10][10],int n,int i,int j,int d){
for(int k=0;k<n;k++){
if(arr[i][k]==d || arr[k][j]==d){
return false;
}
}
int rn=sqrt(n);
int sx=(i/rn)* rn;
int sy=(j/rn)* rn;
for(int x=sx;x<sx+rn;x++){
for(int y=sy;y<sy+rn;y++){
if(arr[x][y]==d){
return false;
}
}
}
return true;
}

void sudokosolver(int arr[10][10],int n,int i,int j){
if(i==n-1 && j==n-1){
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
cout<<arr[i][j]<<" ";
}
cout<<endl;
}
return ;
}
if(j==n){
sudokosolver(arr,n,i+1,0);
return;
}
if(arr[i][j]!=0){
sudokosolver(arr,n,i,j+1);
return ;
}
for(int k=1;k<=9;k++){
if(canplace(arr,n,i,j,k)){
arr[i][j]=k;
sudokosolver(arr,n,i,j+1);
arr[i][j]=0;
}
}
}
int main() {
int n;
cin>>n;
int arr[10][10];
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
cin>>arr[i][j];
}
}
sudokosolver(arr,n,0,0);
return 0;
}

hi @bhardwajsaksham796 updated

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.