Doubt in pattern 13

package pattern;

import java.util.Scanner;

public class pattern13 {

public static void main(String[] args) {
	Scanner scn =new Scanner(System.in);
	int n =scn.nextInt();
	
	int nst=1;
	int nr = 2*n-1;
	
	int row=1;
	while (row<=n) {
		int cst=1;
		while (cst<=nst) {
			System.out.print("*");
			cst++;
		}
		System.out.println();
		if (row<= nr / 2) {
			nst++;
		}
		else {
			nst--;
		}
		row++;
		
	}

}

}
what is wrong in this pattern

hey @harsh.hj just change while (row <= nr) {

but sir ma’am ne to n leke bhi same output nikal diya

let n=5
n se upper half print hoga. ya phir code kuch me change kra hoga.

nhi kia sir I have seen full explaination


line no 23 : while(row<=nr)