For this Question: Tom loves Chess boards. He admires its symmetry and how the black and white colors are placed adjacently along both axis.
More formally, a chessboard-like coloring implies that no two adjacent cells have the same color and all the cells are painted either white or black.
On his birthday, Tom has been gifted a board which is in the form of an N*N grid. Every cell is painted either black or white. Since Tom loves the placement of colors in a chessboard, he will try to convert the board that has been gifted to him, identical to a chessboard. He has both black and white colors available to him. Help him find out the minimum number of cells he will have to recolor to paint his board similar to a chessboard.The first line contains an integer N, denoting the size of the board
Each of the next N lines contains N space-separated integers and each integer being either '0' or '1'
'1' represent black cell
'0' represents white cell

Constraints
1 &le; N &le; 1000A single integer that is the minimum number of cells that Tom will have to re-color in his board to convert the given board to a chess board like coloring.Input:
3
1 1 1
1 1 1
1 1 1

Output:
4

<b>Explanation:</b>
Convert to 
1 0 1
0 1 0
1 0 1
Thus he has to color 4 cells., I have written this Solution Code: n=int(input())
c1,c2 = 0,0
for i in range(0,n):
    arr=list(map(int,input().strip().split()))
    for j in range(0,n):
        p=arr[j]
        x=(i+j)&1
        c1 += (bool)(p == x)
        c2 += (bool)(p != x)
print(min(c1, c2)), In this Programming Language: Python, Now tell me if this Code is compilable or not?