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