Cpp solution
\nclass Solution {\npublic:\n    \n    typedef long long ll;\n    vector<int> v;\n    int dp[13][4097][13];\n    int m, n;\n\t\n    int maximumRows(vector<vecto
```\nclass Solution {\npublic:\n    \n    typedef long long ll;\n    vector<int> v;\n    int dp[13][4097][13];\n    int m, n;\n\t\n    int maximumRows(vector<vector<int>>& mat, int cols) {\n        \n        m = mat.size();\n        n = mat[0].size();\n        \n        for (int i =0; i < m; i++) {\n            \n            int a = 0;\n            for (int j = 0; j < n; j++) {\n                a *= 2;\n                a += mat[i][j];\n            }\n            v.push_back(a);\n        }\n        \n        memset(dp, -1, sizeof(dp));\n        return dfs(0, 0, cols);\n    }\n    \n    int dfs(int i, int j, int cols) {\n        \n        if (dp[i][j][cols] != -1) return dp[i][j][cols];\n        \n        if (cols == 0 | i == n) {\n            int ans = 0;\n            for (auto& num : v) {\n                if ((~j) & num) continue;\n                ans += 1;\n            }\n            \n            return dp[i][j][cols] = ans;\n        }\n        \n        int case1 = dfs(i+1, j | (1 << i), cols - 1);\n        int case2 = dfs(i+1, j, cols);\n        \n        return dp[i][j][cols] = max(case1, case2);\n    }\n};\n```
['Dynamic Programming', 'Bit Manipulation', 'Depth-First Search', 'C++']