2397. Maximum Rows Covered by Columns
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```python3 []
class Solution:
    def maximumRows(self, matrix: List[List[int]], numSelect: int) -> int:
        m, n = len(matrix), len(matrix[0])
        best = 0
        
        for cols in combinations(range(n), numSelect):
            covered = 0
            for row in matrix:
                if all(row[c] == 0 or c in cols for c in range(n)):
                    covered += 1
            best = max(best, covered)
        
        return best

```
['Python3']