Cells with Odd Values in a Matrix LeetCode solution in Python
1class Solution:2def oddCells(self, row: int, col: int, indices: List[List[int]]) -> int:3rows, cols = [False] * row, [False] * col45for index in indices:6rows[index[0]] = not rows[index[0]]7cols[index[1]] = not cols[index[1]]89count = 010for i in rows:11for j in cols:12count += i ^ j1314return count