not sure whats wrong in code output seems to be correct but testcases is giving as wrong answer
import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner scan =new Scanner(System.in);
int N=scan.nextInt();
int nst=1;
int row=1;
int val=row;
while(row<=N&&N>0&&N<100)
{
for(int cst=1;cst<=nst;cst++)
{
if(cst==1||cst==nst)
{
System.out.print(val);
}
else
{
System.out.print(0);
}
}
System.out.println();
nst++;
row++;
val++;
}
}
}