package challanges;
import java.util.Scanner;
public class invertedhourglass {
public static void main(String[] args) {
Scanner scn= new Scanner(System.in);
int n=scn.nextInt();
int nst=1;
int nsp=2*n-1;
int row=0;
while(row<(2*n+1)) {
for(int cst=1;cst<=nst;cst++) {
System.out.print("*");
}
for(int csp=1;csp<=nsp;csp++) {
System.out.print(csp);
}
for(int cst=1;cst<=nst;cst++) {
System.out.print("*");
}
System.out.println();
row++;
if(row<=((2*n+1)/2)) {
nsp=nsp-2;
nst=nst+1;
}
else {
nsp=nsp+2;
nst=nst-1;
}
}
}
}
what is wrong in this code ???