forcest brute of all brute forces
\nclass Solution {\npublic:\n    int ans = -1;\n    int res(int i,vector<int> v,vector<vector<int>>& mat,int cols)\n    {\n        if(i==mat[0].size())\n       
```\nclass Solution {\npublic:\n    int ans = -1;\n    int res(int i,vector<int> v,vector<vector<int>>& mat,int cols)\n    {\n        if(i==mat[0].size())\n        {\n            int ch=0;\n            for(int i=0;i<v.size();i++)\n                if(v[i]==1)\n                    ch++;\n            if(ch==cols)\n            {\n                int val = 0;\n                for(int i=0;i<mat.size();i++){int c=0;\n                    for(int j=0;j<mat[0].size();j++){\n                        if(mat[i][j]==1&&v[j]!=1)\n                            c=-1;}\n                    if(c==0)\n                        val++;\n                }\n                ans = max(val,ans);\n                return -1;\n            }\n            else\n                return -1;\n        }\n        else\n        {\n            v[i]=0;\n            res(i+1,v,mat,cols);\n            v[i]=1;\n            res(i+1,v,mat,cols);\n            return -1;\n        }\n        return -1;\n    }\n    int maximumRows(vector<vector<int>>& mat, int cols) {\n        vector<int> v;\n        for(int i=0;i<mat[0].size();i++)\n            v.push_back(-1);\n        res(0,v,mat,cols);\n        return ans;\n    }\n    \n};\n```
[]