Getting Wrong test cases.Can u please tell me whats wrong in my code

Scanner scn= new Scanner(System.in);
int n=scn.nextInt();
for(int i=1;i<=n;i++) {
for(int j=1;j<=i;j++) {
if(j==1||j==i) {
System.out.print(i);
}else {
System.out.print(0);
}
}
System.out.println();
}

}

@ubaidshaikh9999,
https://ide.codingblocks.com/s/169237 This is the corrected code. You were not printing " " after the numbers. This was the error.