Problem Description
Robin buys an integer matrix A of size N x M.
His mother asked him to perform the following operation exactly once such that the bitwise XOR of the elements is maximized.
Return the maximum value of bitwise XOR of elements after performing the above operation.
1 <= N x M <= 5 * 105
1 <= A[i][j] <= 109
First and only argument is a 2D array A of size N x M.
Return an integer denoting the maximum value of bitwise XOR of the matrix.
Input 1:
A = [ [2, 3] [4, 5] ]
Input 2:
A = [ [1, 2] ]
Output 1:
6
Output 2:
2
Explanation 1:
Select 2nd row and decrement each element. So the new matrix is [[2, 3], [3, 4]]. XOR of elements will be 6.
Explanation 2:
Select 1st col and decrement the only element. New matrix is [[0, 2]]. XOR of elements will be 2.
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a question? Checkout Sample Codes for more details.