Pattern Double SidedArrow

All test cases are giving wrong.But Output is showing correct.
import java.util.*;
public class Double_sided_arrow{
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int nrows = sc.nextInt();
int n =1;
int nsp=nrows;
int nst=1;
int nsp2=-1;
if(nrows%2!=0){
while(n<=(nrows/2)+1){
for(int csp=1;csp<=nsp;csp++){
System.out.print(" β€œ);
}
if(n==1){
for(int cst=nst;cst>=1;cst–){
System.out.print(cst+” β€œ);
}
}
else{
for(int cst=nst;cst>=1;cst–){
System.out.print(cst+” β€œ);
}
for(int csp=1;csp<=nsp2;csp++){
System.out.print(” β€œ);
}
for(int cst=1;cst<=nst;cst++){
System.out.print(cst+” β€œ);
}
}
System.out.println();
n++;
nst++;
nsp2=nsp2+2;
nsp=nsp-2;
}
nsp=nsp+4;
nst=nst-2;
nsp2=nsp2-4;
while(n<=nrows){
for(int csp=1;csp<=nsp;csp++){
System.out.print(” β€œ);
}
if(n<nrows){
for(int cst=nst;cst>=1;cst–){
System.out.print(cst+” ");
}

		for(int csp=1;csp<=nsp2;csp++){
			System.out.print("  ");
		}
		for(int cst=1;cst<=nst;cst++){
			System.out.print(cst+" ");
		}
                  }
                  else{
                     for(int cst=nst;cst>=1;cst--){
				System.out.print(cst+" ");
			}
                  }
		System.out.println();
		n++;
		nsp=nsp+2;
		nst--;
		nsp2=nsp2-2;
	
	}
    
}
}

}

refer to this here: