[Python] Bitmask Brute-Force
\n# Code\npython\ndef maximumGood(A: List[List[int]]) -> int:\n    N, res = len(A), 0\n    for i in range(pow(2,N)):\n        for j in range(N):\n            if
\n# Code\n```python\ndef maximumGood(A: List[List[int]]) -> int:\n    N, res = len(A), 0\n    for i in range(pow(2,N)):\n        for j in range(N):\n            if i&(1<<j) and not all(A[j][k]==2 or A[j][k]==bool(i&(1<<k)) for k in range(N)):\n                break\n        else:\n            res=max(res,bin(i).count("1"))\n    return res\n```\n**time complexity:** `O((2^N)*(N^2))`
['Python3']