Brute-Force + Backtracking
\nclass Solution {\nprivate:\n    int n,m;\n    unordered_map<int,vector<int>> col;\n    int maxRow=0;\n    \n    void selectCol(int currCol,vector<int> selecte
```\nclass Solution {\nprivate:\n    int n,m;\n    unordered_map<int,vector<int>> col;\n    int maxRow=0;\n    \n    void selectCol(int currCol,vector<int> selectedCol,int numSelect,int colSize)\n    {\n        if(selectedCol.size() == numSelect)\n        {\n            unordered_set<int> selectedColSet;\n            for(int col : selectedCol) selectedColSet.insert(col);\n            \n            int count=0;\n            \n            for(int i=0; i<n; i++)\n            {\n                if(col[i].size() == 0)\n                    count++;\n                else\n                {\n                    bool flag=true;\n                    \n                    for(auto& tempCol : col[i])\n                    {\n                        if(selectedColSet.find(tempCol) == selectedColSet.end())\n                        {\n                            flag=false;\n                            break;\n                        }\n                    }\n                    \n                    if(flag)\n                        count++;\n                }\n            }\n            \n            maxRow=max(maxRow,count);\n        }\n        else\n        {\n            for(int i=currCol; i<colSize; i++)\n            {\n                selectedCol.push_back(i);\n                selectCol(i+1,selectedCol,numSelect,colSize);\n                selectedCol.pop_back();\n                selectCol(i+1,selectedCol,numSelect,colSize);\n            }\n        }\n    }\n    \npublic:\n    int maximumRows(vector<vector<int>>& matrix, int numSelect) {\n        n=matrix.size();\n        m=matrix[0].size();        \n                \n        for(int i=0; i<n; i++)\n        {\n            for(int j=0; j<m; j++)\n            {\n                if(matrix[i][j] == 1)\n                    col[i].push_back(j);\n            }\n        }\n        \n        selectCol(0,{},numSelect,m);\n        \n        return maxRow;\n    }\n};\n```
['C']