You are given a matrix of integers matrix of size n × m and a...
You are given a matrix of integers matrix of size n × m and a list
of queries queries.
The given matrix is colored in black and white in a checkerboard style - the top left corner is colored white and any two side-neighboring cells have opposite colors.
Each query is represented as a pair of indices (i, j). For each query, perform the following operations:
matrix = [[2, 0, 4],
[2, 8, 5],
[6, 0, 9],
[2, 7, 10],
[4, 3, 4]]
queries = [[0, 0], [1, 3]]
'''
output should be meanAndChessboard(matrix, queries) = [[1, 2, 4],
[2, 8, 5],
[6, 0, 9],
[2, 7, 10],
[4, 3, 3]]
''' matrix = [[1, 9, 10, 8],
[3, 4, 4, 4]]
queries = [[2, 3], [3, 2]]
'''
the output should be meanAndChessboard(matrix, queries) = [[1, 9, 9, 7],
[3, 4, 4, 6]]
'''