Maximum Good People Based on Statements Solution::
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 {\n public:\n  int maximumGood(vector<vector<int>>& statements) {\n    const int maxMask = 1 << statements.size();\n    int ans = 0;\n\n    for (int mask = 0; mask < maxMask; ++mask)\n      if (isValid(statements, mask))\n        ans = max(ans, __builtin_popcount(mask));\n\n    return ans;\n  }\n\n private:\n  bool isValid(const vector<vector<int>>& statements, int mask) {\n    for (int i = 0; i < statements.size(); ++i) {\n      if ((mask >> i & 1) == 0) \n        continue;\n      for (int j = 0; j < statements.size(); ++j) {\n        if (statements[i][j] == 2)\n          continue;\n        if (statements[i][j] != (mask >> j & 1))\n          return false;\n      }\n    }\n    return true;\n  }\n};\n```
['C++']