Easy Solution || Try out all possible things || Bit-Mask
Intuition\n\nn is max to max 15, so you can choose some of people as good people. To represent that use Bit-mask of n bits , where 1 means good person , don\'t 
# Intuition\n\nn is max to max 15, so you can choose some of people as good people. To represent that use Bit-mask of n bits , where 1 means good person , don\'t worry about bad person. \n\nthen fix that good people and iterate through our matrix ,\n \nand check for good people\'s statement if at any point it contradict then this choosen set of people as good people not valid.  \n\n\n# Complexity\n- Time complexity: O( 1<<n * n * n )\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int maximumGood(vector<vector<int>>& st) {\n        \n\n        int ans = 0; \n        int sz = st.size(); \n        int n = (1 << sz); \n\n        int result = 0; \n        int maxi = 0; \n\n        for(int i = 0 ; i < n ; i++){\n            \n            vector<int> fin(sz , -1); \n            vector <int > here(sz , 0); \n            bool flag = true; \n            for(int j = 0 ; j < sz ; j++){\n                int cur = (1<<j); \n                if(i & cur){\n                    here[j] = 1; \n                }\n            }\n\n            // decide that this only are good person. \n            for(int x = 0 ; x < sz ; x++) {\n                if(here[x] == 1) fin[x] = 1; \n            }\n\n            for(int p = 0; p < sz ; p++){\n\n                // you can not assign any new good person \n                if(here[p] == 1){\n\n                    for(int q = 0; q < sz ; q++){\n\n                        if(st[p][q] == 0){\n                            if(fin[q] == -1) fin[q] = 0; \n                            else if(fin[q] != 0){\n                                flag = false; \n                                break; \n                            }\n                        }\n                        else if(st[p][q] == 1){\n                            if(fin[q] != 1){\n                                flag = false; \n                                break; \n                            }\n                        }\n\n                    }\n                    if(flag == false) break; \n                }\n            }\n            if(flag){\n                result = max(result , __builtin_popcount(i)); \n            }\n        }\n        return result; \n    }\n};\n```
['C++']