Super Easy Recursive Code || Java
\nclass Solution {\n    int m,n,res = 0, arr[], cols,mat[][];\n    public int maximumRows(int[][] mat, int cols) {\n        m = mat.length;\n        n = mat[0].
```\nclass Solution {\n    int m,n,res = 0, arr[], cols,mat[][];\n    public int maximumRows(int[][] mat, int cols) {\n        m = mat.length;\n        n = mat[0].length;\n        this.cols = cols;\n        arr = new int[cols];\n        this.mat = mat;\n        recurse(-1,-1);\n        return res;\n    }\n    \n    void recurse(int i, int donetill){\n        i++; donetill++;\n        if(i == cols) check();\n        else{\n            for(int j = donetill;j<n;j++){\n                arr[i] = j;\n                recurse(i,j);\n            }\n        }\n    }\n    \n    void check(){\n        int count = 0,i,j;\n        boolean flag;\n        HashSet<Integer> colsSelected = new HashSet<Integer>();\n        for(int col : arr) colsSelected.add(col);\n        for(i=0;i<m;i++){\n            flag = true;\n            for(j=0;j<n;j++){\n                if(mat[i][j]==1 && !colsSelected.contains(j)){\n                    flag = false;\n                    break;\n                }\n            }\n            if(flag) count++;\n        }\n        res = Math.max(res, count);\n    }\n}\n\n```
['Recursion', 'Java']