help. im getting right output but last 3 validations checks failing for the chess task
package en.codegym.task.jdk13.task06.task0634;
import java.util.Scanner;
import java.io.*;
/*
Chess board
*/
public class Solution {
public static char[][] array;
public static void main(String[] args) throws Exception {
//write your code here
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int input = Integer.parseInt(reader.readLine());
char[][] chessBoard =new char[input][input];
int c = 0;
for (int i = 0; i < chessBoard.length; i++) {
char[] chess = chessBoard[i];
for (int j = 0; j < chess.length; j++ ) {
if (c % 2 == 0) {
chess[j] = '#';
} else {
chess[j] = ' ';
}
// System.out.print(chess[j]);
c++;
}
// System.out.println();
}
for (int i = 0; i < chessBoard.length; i++) {
char[] chess = chessBoard[i];
for (int j = 0; j < chess.length; j++) {
System.out.print(chess[j]);
}
System.out.println();
}
}
}