Is nst necessary

int n = 7;
int row = 1;

	while(row <= n) {
		int col = 1;
		while(col <= row) {
			System.out.print("* ");
			col++;
		}
		System.out.println();
		row++;
	}

I have gotten the exact same answer using this code, So I was wondering whether the use of the extra variable nst is beneficial in some way?

@devanshsood2000_b7de8cac3ff0472d It is not necessary to use nst variable here but to build up the concept and to get a pattern to solve all types of pattern questions. I would advice that you use nst here also. However it is not necessary

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.