Q36Numerical3 Marks7 Aug 2022
What is the output of the following snippet of code? Each entry in the matrix board has one of these two characters: 'X' or 'O'. Your answer should be an integer.
```
def status(M):
n = len(M)
for i in range(n):
index = 1
for j in range(n):
if M[i][j] != M[i][0]:
index = -1
break
if index >= 0:
break
return i
board = [['X', 'X', 'O', 'X', 'O', 'X'],
['O', 'X', 'O', 'O', 'X', 'X'],
['O', 'X', 'O', 'O', 'O', 'X'],
['O', 'O', 'O', 'O', 'O', 'O'],
['X', 'O', 'O', 'X', 'X', 'X'],
['X', 'X', 'O', 'X', 'O', 'O']]
print(status(board))
```
Press Enter to check.