Write code for, given a non-negative integer , where for some , printing a chess board of size , as shown in the examples.
The program must implement and use the CHESS-BOARD function, which can be iterative or recursive and is not allowed to perform input/output operations.
Make one submission with Python code and another submission with C++ code.
The input is an integer of the form for some .
The output is a chess board of size .
The size of a chess board is always of the form for some .
Input
2
Output
01 10
Input
4
Output
0101 1010 0101 1010
Input
8
Output
01010101 10101010 01010101 10101010 01010101 10101010 01010101 10101010