Double sided arrow test case 0 failed

import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner scn = new Scanner(System.in);
int n = scn.nextInt();
int row = 1;
while (row <= n) {
if (row <= n / 2) {
int nsp = 1;
while (nsp <= n - 1 - 2 * (row - 1)) {
System.out.print(" ");
nsp++;

			}
			int nst = 1;
			while (nst <= row) {
				System.out.print((row - nst + 1) + " ");
				nst++;
			}
			int csp = 1;
			while (csp <= 2 * row - 3) {
				System.out.print("  ");
				csp++;
			}
			int cst = 1;
			while (cst <= row) {
				if (row != 1) {
					System.out.print((cst) + " ");
				}
				cst++;
			}
		}
		if (row == ((n + 1) / 2)) {
			int mst = ((n + 1) / 2);
			while (mst >= 1) {
				System.out.print((mst) + " ");
				mst--;
			}
			int msp = 1;
			while (msp <= 2 * row - 3) {
				System.out.print("  ");
				msp++;

			}
			int ost = 1;
			while (ost <= row) {
				System.out.print((ost) + " ");
				ost++;
			}
		}
		if (row > ((n + 1) / 2)) {
			int psp = 1;
			while (psp <= n - 1 - 2 * (n - row)) {
				System.out.print("  ");
				psp++;

			}
			int pst = 1;
			while (pst <= n-row+1) {
				System.out.print((n - row - pst + 2) + " ");
				pst++;

			}
			int qsp = 1;
			while (qsp <= 2 * (n - row + 1) - 3) {
				System.out.print("  ");
				qsp++;
			}
			int qst = 1;
			while (qst <= n-row+1) {
				if (row != n) {
					System.out.print((qst) + " ");
				}
				qst++;
			}

		}
		System.out.println();
		row++;
	}

}

}

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.