Pattern double sided arrow

import java.util.;
public class Main {
public static void main(String args[]) {
Scanner sc=new Scanner(System.in);
int N=sc.nextInt();
int spaces=N-3;
int dash=2;
int temp=N/2;
int spa=1;
if(N%2!=0){
for(int i=1;i<=1;i++){
for(int j=1;j<=N-1;j++){
System.out.print(" β€œ);
}
for(int j=1;j<=1;j++){
System.out.print(j+” β€œ);
}
for(int j=1;j<=N-1;j++){
System.out.print(” β€œ);
}
System.out.println();
}
for(int i=1;i<(N/2)+1;i++){
for(int j=1;j<=spaces;j++){
System.out.print(” β€œ);
}
//spaces=spaces-2;
for(int j=i+1;j>=1;j–){
System.out.print(j+” ");
}
for(int j=1;j<=2
i-1;j++){
System.out.print(" β€œ);
}
for(int j=1;j<=i+1;j++){
System.out.print(j+” β€œ);
}
for(int j=1;j<=spaces;j++){
System.out.print(” β€œ);
}
spaces=spaces-2;
System.out.println();
}
for(int i=(N/2)+2;i<=N-1;i++){
for(int j=1;j<=dash;j++){
System.out.print(” β€œ);
}
for(int j=temp;j>=1;j–){
System.out.print(j+” β€œ);
}
for(int j=N-4;j>=spa;j–){
System.out.print(” β€œ);
}
for(int j=1;j<=N-i+1;j++){
System.out.print(j+” β€œ);
}
for(int j=1;j<=dash;j++){
System.out.print(” ");
}

		temp--;
		spa=spa+2;
		dash=dash+2;
		System.out.println();
	}
	for(int i=1;i<=1;i++){
		for(int j=1;j<=N-1;j++){
			System.out.print("  ");
		}
		for(int j=1;j<=1;j++){
			System.out.print(j+" ");
		}
		for(int j=1;j<=N-1;j++){
			System.out.print("  ");
		}
		System.out.println();
	}
}
}

}

i have cross checked with diff inputs the pattern is perfectly fine but out of 8 test cases 1 case is failed iam unable to identify it help me out with this

@niharikareddykeesara_139be65b4266e2f2 before I tell you the solution to your doubt there’s a little advice I would give that whenever you send code in your doubt body. Add three double quotes before and after your code starts and ends.

β€œβ€"
//Code
β€œβ€"
Your output is failing for the same reason your code failed in Pattern Rhombus Question:
Now your one test case is failing because : when the input is : 1
Correct output = 1
Your Code is giving :
1
1