this is the code
import java.util.;
public class Main {
public static void main(String args[]) {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int nst=n,nsp=1;
for(int row=1;row<=n;row++)
{
int val=1;
for(int cst=1;cst<=nst;cst++)
{
System.out.print(val);
val=val+1;
}
if(row>1)
{
for(int csp=1;csp<=nsp;csp++)
{
System.out.print("");
}
}
System.out.println();
nst=nst-1;
if(row>1)
{
nsp=nsp+2;
}
}
}
}
Doubt in pattern numbers and stars 1, I cannot understand why all test cases are not passed
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.