C++ bitMask Easy to Understand
# 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```cpp []\nclass Solution {\npublic:\n    int maximumGood(vector<vector<int>>& statements) {\n        int n = statements[0].size();\n        int bitMask = (1<<n);\n        int ret = 0;\n        while(bitMask--){\n            int flag=1;\n            vector<int> isGood(n,0);\n            for(int i=0;i<n;i++){\n                int subMask = 1<<i;\n                isGood[i] = bitMask & subMask ? 1 : 0;\n            }\n\n            for(int i=0;i<n && flag;i++){\n                for(int j=0;j<n && flag;j++){\n                    if(isGood[i] && statements[i][j]!=2 && statements[i][j] != isGood[j]){\n                        flag=0;\n                    }\n                }\n            }\n\n            if(flag){\n                int count=0;\n                for(int i: isGood) count+=i;\n                ret = max(count,ret);\n            }           \n        }\n        \n        return ret;\n    }\n};\n```
['C++']