class Solution(object):
def maxEqualRowsAfterFlips(self, matrix):
"""
:type matrix: List[List[int]]
:rtype: int
"""
cnt = collections.Counter()
for row in matrix:
cnt[tuple(row) if row[0] == 0 else tuple(x ^ 1 for x in row)] += 1
return max(cnt.values())