Simple Backtracking c++
```\nclass Solution {\npublic:\n    void pickcolumn(int i,vector>& mat, int cols,int currcols, vector&visited, int &ans){\n        if(i==mat[0].size()){\n      
```\nclass Solution {\npublic:\n    void pickcolumn(int i,vector<vector<int>>& mat, int cols,int currcols, vector<bool>&visited, int &ans){\n        if(i==mat[0].size()){\n            int count=0;\n            for(int i=0;i<mat.size();i++){\n                bool flag=true;\n                for(int j=0;j<mat[0].size();j++){\n                    if(mat[i][j]==1){\n                        if(!visited[j]){\n                          flag=false;\n                            break;\n                        }\n                    }\n                }\n                if(flag){\n                    count++;\n                }\n            }\n            ans=max(ans,count);\n            return;\n        }\n        \n        if(currcols<cols){\n          visited[i]=true;  \n          pickcolumn(i+1,mat,cols,currcols+1,visited,ans);    \n          visited[i]=false;\n        }\n        pickcolumn(i+1,mat,cols,currcols,visited,ans);\n        \n    }\n    int maximumRows(vector<vector<int>>& mat, int cols) {\n        \n        int currcols=0;\n        int ans=0;\n        vector<bool>visited(mat[0].size(),0);\n        pickcolumn(0,mat, cols,currcols,visited,ans);\n        \n        return ans;\n        \n    }\n};
['Backtracking', 'Recursion']