my logic for the given pattern is
Scanner scn = new Scanner(System.in);
int n=scn.nextInt();
int nsp=n-1;
int nst=1;
// row work
int row=1;
while(row<=n) {
for(int csp=1; csp<=nsp;csp++) {
System.out.print(" “);
}
for(int cst=1; cst<=nst; cst++) {
System.out.print(”*"+"\t");
}
System.out.println();
nsp=nsp-1;
nst=nst+2;
row=row+1;