My compilation successful but i cant pass any test cases because i am unable to do space between two number please resolve my problem

import java.util.*;
public class Main {
public static void main(String args[]) {

Scanner s=new Scanner(System.in);

	int n=s.nextInt();
	int m=2*n+1;
	int nst=n;
	int nsp=0;
	int row=1;
	
	
	while(row<=m)
	{
		
		for(int csp=1;csp<=nsp;csp++)
		{
			System.out.print(" ");
			
		}
		
		for(int cst=nst;cst>=0;cst--)
		{
			System.out.print(cst);
			
			
		}
		
		int cst=1;
		
		for(;cst<=nst;cst++) {
			System.out.print(cst);
			
			
		}
		System.out.println();
		if(row<=m/2)
		{
			nsp++;
			nst--;
			
		}
		else
		{
			nsp--;
			nst++;
			
		}
		
		
		
		row++;
		
	}
	
	

}

}

public static void main(String[] args) {
	Scanner s=new Scanner(System.in);

	int n=s.nextInt();
	int m=2*n+1;
	int nst=n;
	int nsp=0;
	int row=1;
	
	
	while(row<=m)
	{
		
		for(int csp=1;csp<=nsp;csp++)
		{
			System.out.print(" ");
			
		}
		
		for(int cst=nst;cst>=0;cst--)
		{
			System.out.print(cst+" ");
			
			
		}
		
		int cst=1;
		for(;cst<=nst;cst++) {
			System.out.print(cst+" ");
			
			
		}
		System.out.println();
		if(row<=m/2)
		{
			nsp+=2;
			nst--;
			
		}
		else
		{
			nsp-=2;
			nst++;
			
		}
		
		
		
		row++;
		
	}
	
	


}

@Ajstar Bro I have corrected your code. I have just added space after printing the number and do nsp+=2 after every iteration.