very simple solution 🥷beats 💯🤟
\n\n# Code\njava []\nclass Solution {\n    public int maximumRows(int[][] matrix, int numSelect) {\n        int n = matrix.length;\n        int m = matrix[0].le
\n\n# Code\n```java []\nclass Solution {\n    public int maximumRows(int[][] matrix, int numSelect) {\n        int n = matrix.length;\n        int m = matrix[0].length;\n        if (numSelect > m) return 0;\n\n        boolean[] taken = new boolean[m];\n        return find(0, 0, n, m, matrix, numSelect, taken);\n    }\n\n    int find(int steps, int start, int n, int m, int[][] matrix, int numSelect, boolean[] taken) {\n        if (steps == numSelect) {\n            return calculate(n, m, matrix, taken);\n        }\n\n        int res = 0;\n        for (int i = start; i < m; i++) {\n            {\n                taken[i] = true;\n                res = Math.max(res, find(steps + 1, i + 1, n, m, matrix, numSelect, taken));\n                taken[i] = false;\n            }\n        }\n        return res;\n    }\n\n    int calculate(int n, int m, int[][] matrix, boolean[] taken) {\n        int res = 0;\n        for (int i = 0; i < n; i++) {\n            boolean isCovered = true;\n            for (int j = 0; j < m; j++) {\n                if (matrix[i][j] == 1 && !taken[j]) {\n                    isCovered = false;\n                    break;\n                }\n            }\n            if (isCovered) res++;\n        }\n        return res;\n    }\n}\n\n```
['Java']