import java.util.*;
class PatternI {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
for (int i = 1; i <= n; i++) {
if (i % 2 == 0) {
for (int j = 0; j < i; j++) {
if (j == 0 || j == i - 1) {
System.out.print(“1” + " ");
} else {
System.out.print(“0” + " ");
}
}
} else {
for (int j = 0; j < i; j++) {
System.out.print("1" + " ");
}
}
System.out.println();
}
}
}
My code got only one test case passed.Please help me fixing it?