Simple Bit Masking Solution⚡🔥🔥
\n# Code\n\nclass Solution {\npublic:\n    bool valid(int m,vector<vector<int>>&statement){\n        int N=statement.size();\n        for(int i=0;i<N;i++){\n   
\n# Code\n```\nclass Solution {\npublic:\n    bool valid(int m,vector<vector<int>>&statement){\n        int N=statement.size();\n        for(int i=0;i<N;i++){\n            if(m>>i & 1){\n                for(int j=0;j<N;j++){\n                    int good=m>>j & 1;\n                    if((statement[i][j]==0 && good) ||(statement[i][j]==1 && !good))return false;\n                }\n            }\n        }\n        return true;\n    }\n    int maximumGood(vector<vector<int>>& statement) {\n        int n=statement.size();\n        int ans=0;\n        for(int i=0;i< (1<<n);i++){\n            if(valid(i,statement)){\n                ans=max(ans,__builtin_popcount(i));\n            }\n\n        }\n        return ans;\n        \n    }\n};\n```
['Bitmask', 'C++']