Doubt about hollow diamond pattern

Scanner scn=new Scanner(System.in);
int n=scn.nextInt();
int nst=n/2+1;
int nsp=0;
int row=1;
while(row<=n) {
for(int cst=1;cst<=nst;cst++) {
System.out.print("*"+"\t");
}
for(int csp=2;csp<=nsp;csp++) {
System.out.print(" β€œ+”\t");
}
int cst=1;

		if(row==n ) {
			cst=2;
		}
		 if(row==1) {
			cst=n/2;
			
		}
		for(;cst<=nst;cst++) {
		     System.out.print("*"+"\t");
		}
		System.out.println();
		if(row<=n/2) {
			nsp=nsp+2;
			nst--;
		}
		else {
			nsp=nsp-2;
			nst++;
		}
		row++;
		
	}

what is wrong in this code

don’t use tabs for spaces, use a single space and infact, your logic is incorrect. See how do you print the ith row, first print x - i + 1 asterisks, then print spaces and then again print x - i + 1 asterisks. In this way, you print the upper half of the pattern , then for lower half just print its inverse. here x is the same as your nst.