Recursive | Python 3 | Beats 70%
IntuitionCollect rows whose col_idx = 1 into a dictionary, and enumerate columns picked, to see which has the max coverageApproachrow dictionary:
dic[row] = [i,
# Intuition
Collect rows whose col_idx = 1 into a dictionary, and enumerate columns picked, to see which has the max coverage 

# Approach
row dictionary:
dic[row] = [i, j, k] # column index with the cell [row, i] = 1
Enumerate all possible selection of columns with amount = numSelect 
During enumeration, we have two choice, choose column j or not? 

Recursion base case:
(1) column_idx < n 
(2) number of selected columns = numSelect or not? If = numSelect, then time to find the max_row_cover 

# Complexity
- Time complexity:
O(2^n) # n is the number of columns in total 

- Space complexity:
O(n)

# Code
```python3 []
class Solution:
    def maximumRows(self, matrix: List[List[int]], numSelect: int) -> int:
        m, n = len(matrix), len(matrix[0])
        rowdic = defaultdict(list)
        for r in range(m):
            for c in range(n):
                if matrix[r][c] == 1:
                    rowdic[r].append(c)
        allzero = m - len(rowdic)
        maxcover = 0
        cols = []
        
        def dfs(i: int) -> int:
            nonlocal maxcover
            if i >= n:
                if len(cols) == numSelect:
                    colset = set(cols)
                    cnt = 0
                    for key in list(rowdic.keys()):
                        good = True
                        for idx in rowdic[key]:
                            if idx not in colset:
                                good = False
                                break
                        if good:
                            cnt += 1
                    cnt += allzero
                    maxcover = max(maxcover, cnt)
                return

            # not pick ith column
            dfs(i+1)

            # pick ith column
            cols.append(i)
            dfs(i+1)
            cols.pop()
        
        dfs(0)
        return maxcover

```
['Backtracking', 'Matrix', 'Enumeration', 'Python3']