bits of zeros and ones with m rows and n columns. In one move you may pick any row or any column and flip every bit in it: zeros turn into ones and ones into zeros.
Each row is read left to right as a binary number. The value of the table is the sum of these numbers over all rows.
Make as many moves as you like (possibly none) and return the largest value the table can reach.bits=[[0, 1, 1], [1, 1, 0]] → 12
Flip the first row to get 100, then the second column: the rows become 110 and 100. That is 6 + 4 = 10, and nothing beats it.
bits=[[0, 0], [0, 0]] → 6
Flip both rows: 11 + 11 = 3 + 3 = 6.
nbits[i][j] is 0 or 1bits=[[0, 1, 1], [1, 1, 0]]
12
Run checks the first 3 tests in your browser. Submit checks all 82 tests on the server, hidden ones included.