Backtracking+ set
Okay so, I will tell you my simple approach for this question.\nI came up with this approach after I saw theconstraints at the contest.\nBasically the solution 
Okay so, I will tell you my simple approach for this question.\nI came up with this approach after I saw theconstraints at the contest.\nBasically the solution is:-\n1. select all the sets of columns of size cols.\n2. For each set count the number of covered rows \n3. keep a counter to count the maximum.\n```\nclass Solution {\npublic:\n    int res=0;\n    int find_rows(vector<vector<int>>& mat,unordered_set<int> &col_set)\n    {\n        int ans=0;\n        int m=mat.size();\n        int n=mat[0].size();\n        for(int i=0;i<m;i++)\n        {\n            bool val=true;\n            for(int j=0;j<n;j++)\n            {\n                if(mat[i][j]==1 and col_set.find(j)==col_set.end())\n                    val=false;\n            }\n            if(val)\n                ans++;\n        }\n    return ans;\n    }\n    void add_col(unordered_set<int> &col_set,int n,int cols,int idx,vector<vector<int>> &mat)\n    {\n        if(col_set.size()==cols)\n        {\n            res=max(find_rows(mat,col_set),res);\n            return;\n        }\n        for(int j=idx;j<n;j++)\n        {\n            col_set.insert(j);\n            add_col(col_set,n,cols,j+1,mat);\n            col_set.erase(j);\n        }\n    }\n    int maximumRows(vector<vector<int>>& mat, int cols) \n    {\n        int m=mat.size();\n        int n=mat[0].size();\n        unordered_set<int> col_set;\n        for(int j=0;j<=n-cols;j++)\n        {\n            col_set.insert(j);\n            add_col(col_set,n,cols,j+1,mat);\n            col_set.erase(j);\n        }\n    return res;\n    }\n};\n```
['Backtracking', 'Ordered Set']