[java] ✔one the easiest solution with Explanation [Pick || notPick] Approach.
Approach - if you look at problem in little deep , you can directly see that for each column we have two option\n1. pick that column (if picked then, go to next
Approach - if you look at problem in little deep , you can directly see that for each column we have two option\n1. pick that column (if picked then, go to next index and increased the count of total picked column)\n2.  Not pick that column (if not picked, got to next step in this case since we have not picked it total count is not going to increase).\n\n**Base Condition Explanation**\nThink logically when we are going to hit base i,e {index == matrix[0].length} simple.\nand if base condition is met that we need to do, we need to calculate total of rows covered with currently selected column.\n\n```\npublic int maximumRows(int[][] mat, int cols) {\n        boolean[] visited = new boolean[mat[0].length];\n        return solve(mat, cols, 0, 0, visited);\n    }\n    private static int solve(int[][] arr, int cols, int index, int curTotalPicked, boolean[] visited) {\n        if (index == arr[0].length) {\n            int count = 0;\n            for (int i = 0; i < arr.length; i++) {\n                boolean flag = true;\n                for (int j = 0; j < arr[0].length; j++) {\n                    if (arr[i][j] == 1) {\n                        if (!visited[j]) {\n                            flag = false;\n                        }\n                    }\n                }\n\n                if (flag) {\n                    count++;\n                }\n            }\n            return count;\n        }\n\n        int pick = 0;\n        if (curTotalPicked < cols) {\n            visited[index] = true;\n            pick = solve(arr, cols, index + 1, curTotalPicked + 1, visited);\n            visited[index] = false;\n        }\n        int notPick = solve(arr, cols, index +1, curTotalPicked, visited);\n        return Math.max(pick, notPick);\n    }\n```
['Java']