Brute Force + Bitmasking
\nclass Solution {\n\npublic:\n    int maximumRows(vector<vector<int>>& mat, int cols) {\n       \n        int mx = 0;\n       \n        for(int mask=0,cur = 0;
```\nclass Solution {\n\npublic:\n    int maximumRows(vector<vector<int>>& mat, int cols) {\n       \n        int mx = 0;\n       \n        for(int mask=0,cur = 0;mask<(1ll<<(mat[0].size()+1));mask++)\n        {\n\t\t\t\tif(__builtin_popcount(mask) > cols)  // basically checking if no of chosen \n\t\t\t\t\tcontinue;              //columns is exceeding the value of  cols\n                \n            cur = 0;\n           \n            for(int i=0;i<mat.size();i++)\n            {\n               \n                int cnt = 0;\n                bool flag = 1;\n               \n                for(int j=0;j<mat[0].size();j++)\n                {\n\t\t\t\t\tif(((mask&(1<<j))==0) and mat[i][j]==1)   //  this is cutting the loop off, \n\t\t\t\t\t\t\t\t\t\t\t//because the current bit is not set but the current column is set\n                    {\n                        flag = 0;\n                        break;\n                    }\n                }\n               \n                if(flag)\n                    cur++;  // if the current row gets checked by the condition then  increment cur\n            }\n           \n            mx = max(mx,cur);\n        }\n       \n        return mx;\n    }\n};\n```
['C', 'Bitmask']