Brute Force || Java
\n    static int maximumRows(int[][] mat, int cols) {\n        return getResult(mat, cols, new HashSet<Integer>(),0) ;\n    }\n    static int getResult(int [][]
```\n    static int maximumRows(int[][] mat, int cols) {\n        return getResult(mat, cols, new HashSet<Integer>(),0) ;\n    }\n    static int getResult(int [][] mat, int cols, Set<Integer> set, int x){\n        int maxResult = 0;\n        if(cols == 0){\n            int count = 0;\n            for(int i = 0; i < mat.length; i++) {\n                int [] row = mat[i];\n                boolean flag = true;\n                for(int col = 0; col < row.length; col++){\n                    if(row[col] == 1 && !set.contains(col)){\n                        flag = false; break;\n                    }\n                }\n                if(flag) count++;\n\n            }\n            return count;\n        }\n\n        for(int i = x; i < mat[0].length; i++) {\n            set.add(i);\n            maxResult = Math.max(maxResult, getResult(mat, cols - 1, set, i+1));\n            set.remove(i);\n        }\n        return maxResult;\n    }\n```
[]