Iteration Solution with FULLY explanation || 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 
# 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//0:bad\n//1:good\n    int maximumGood(vector<vector<int>>& statements) \n    {\n        int n = statements.size();\n        int ans = 0;\n        for (int bitmask = 1; bitmask < (1<<n); bitmask ++)\n        {\n            bool check = true;\n            for (int i = 0; i < n; i++)\n            {\n                if ( !(bitmask&(1<<i)) ) continue; // if p is bad in this bitmask -> then dont trust p\n                // cause they may lie or not -> cant caculate\n                // only trust the good one\n                // then check if the one we chose is truly good\n                for (int j = 0; j < n; j++ )\n                {\n                    if (statements[i][j] == 0 && (bitmask&(1<<j))) // if p said bad but the bitmask is good\n                    {\n                        check = false;\n                        break;\n                    }\n                    else if ( statements[i][j] == 1 && ( !(bitmask&(1<<j))) ) // p said good but bitmask said bad\n                    {\n                        check = false;\n                        break;\n                    }\n                }\n                // if check is not true then the chose one is lying then dont trust\n                if ( !check )\n                    break;        // find other good people\n            }\n            // if this bitmask can be accepted\n            if ( check )   \n            {\n                ans = max(ans, __builtin_popcount(bitmask) );\n            }\n        }\n        return ans;\n    }\n};\n```
['C++']