Test case answer wrong. but i checked they are correct

import java.util.Scanner;

public class REVERSE_PATTERN {

public static void main(String[] args) {
	Scanner input=new Scanner(System.in);
	int N=input.nextInt();
	pattern(N);

}
public static void pattern(int N) {
	int i,j,n,m,d,e,f,g;
	n=m=d=N;
	e=g=1;
	int c=f=N-1;
	int a=n*2;
	for(i=0;i<=a;i++) {
		if(i<=N ) {
		for(j=0;j<i;j++) {
			System.out.print(" ");
		}
		for(j=n;j>=0;j--) {
			System.out.print(j);
		}
		for(j=1;j<=m;j++) {
			System.out.print(j);
		}
		for(j=0;j<i;j++) {
			System.out.print(" ");
		}
		System.out.println("");
		n--;
		m--;
		}
		else {
		for(j=0;j<f;j++) {
			System.out.print(" ");
		}
		for(j=g;j>=0;j--) {
			System.out.print(j);
		}
		for(j=1;j<=e;j++) {
			System.out.print(j);
		}
		for(j=0;j<f;j++) {
			System.out.print(" ");
		}
		System.out.println("");
		d--;
		e++;
		g++;
		f--;
	}
	
	}
}

}

@KUNAL.SHARMA5724510,

Only mistake is you have to print a space after every number you print. And instead of single space (" “), do double (” ") .

I have corrected your code: https://ide.codingblocks.com/s/207490

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.