Easy c++ bitmask
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int maximumGood(vector<vector<int>>& statements) {\n        int n = statements.size();\n        int bitmask = (1 << n) - 1;\n        int ans = 0;\n\n        for(int bit = 0; bit <= bitmask; bit++){\n            int numOf1 = __builtin_popcount(bit);\n            if(numOf1 <= ans)\n                continue;\n            int flag  = 1;\n            for(int i = 0 ; i < n; i++){\n                if (bit & (1 << i)) { // good person\n                    for(int j = 0; j < n; j++){\n                        int tmp = (bit >> j) & 1;\n                        if( (statements[i][j] != 2) &&  (statements[i][j] != tmp) ){\n                            flag = 0;\n                            break;\n                        }\n                    }\n                }\n                if(!flag)\n                    break;\n            }\n\n            if(flag){\n               ans = max(ans, numOf1);\n            }\n        }\n\n        return ans;\n    }\n};\n```
['C++']