C++ Recursive approach
\nvoid rec(vector<vector<int>> & statements,int &ans,vector<int> &vec,int ind){\n        int count=0;\n        if(vec.size()!=0){\n            for(int i=0;i<vec
```\nvoid rec(vector<vector<int>> & statements,int &ans,vector<int> &vec,int ind){\n        int count=0;\n        if(vec.size()!=0){\n            for(int i=0;i<vec.size();i++){\n                int j;\n                for(j=0;j<statements[vec[i]].size();j++){\n                    if(statements[vec[i]][j]==0)\n                    if(binary_search(vec.begin(),vec.end(),j)){\n                        return ;\n                    }\n                    if(statements[vec[i]][j]==1){\n                        if(not binary_search(vec.begin(),vec.end(),j)){\n                            break;\n                        }\n                    }\n                }\n                if(j==statements[0].size()) count++;\n            }\n            if(count==vec.size())\n            ans=max(ans,(int)vec.size());\n        }\n        if(ind>=statements.size())return ;\n        rec(statements,ans,vec,ind+1);\n        vec.push_back(ind);\n        rec(statements,ans,vec,ind+1);\n        vec.pop_back();\n    }\n    int maximumGood(vector<vector<int>>& statements) {\n        int ans=0;\n        vector<int> vec;\n        rec(statements,ans,vec,0);\n        return ans;\n    }\n```
['Recursion']