2151. Maximum Good People Based on Statements
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\n---\n\n```\nvar maximumGood = function (statementMadeByiAboutj) {\n  const NO_COMMENT = 2;\n  const m = statementMadeByiAboutj.length;\n  const n = statementMadeByiAboutj[0].length;\n  let ans = 0;\n  outer: for (let possibleStatements = 0; possibleStatements < 1 << m; possibleStatements++) {\n    for (let i = 0; i < m; i++) {\n      const iStatus = (possibleStatements >> i) & 1;\n      if (iStatus) {\n        for (let j = 0; j < n; j++) {\n          const jStatus = (possibleStatements >> j) & 1;\n          if (statementMadeByiAboutj[i][j] === NO_COMMENT) continue;\n          if (statementMadeByiAboutj[i][j] !== jStatus) continue outer;\n        }\n      }\n    }\n    ans = Math.max(ans, popCount(possibleStatements));\n  }\n  return ans;\n  function popCount(num) {\n    let count = 0;\n    while (num) {\n      num &= num - 1;\n      count++;\n    }\n    return count;\n  }\n};\n```\n\n---\n
['JavaScript']