bitmask + brute force in python3
check all possible combinations, return the maximum number of possible 1s in the bitmask\n\n# Code\n\nclass Solution:\n    def maximumGood(self, statements: Lis
check all possible combinations, return the maximum number of possible 1s in the bitmask\n\n# Code\n```\nclass Solution:\n    def maximumGood(self, statements: List[List[int]]) -> int:\n        n = len(statements)\n        res = 0\n        for mask in range(2**n):\n            feasible = True\n            for i in range(n):\n                A = (mask & (1<<i)) >> i\n                if A == 0:continue\n                for j in range(n):\n                    if statements[i][j]<2:\n                        B = (mask & (1<<j)) >> j\n                        if A ^ B == statements[i][j]:\n                            feasible = False\n                            break\n                if not feasible:\n                    break\n            if feasible:\n                res = max(res,format(mask,\'b\').count(\'1\'))\n        return res\n```
['Bit Manipulation', 'Bitmask', 'Python3']