Python 3  ||   5 lines, combinations  ||   T/S: 99% / 92%
\nclass Solution:\n    def maximumRows(self, mat: List[List[int]], cols: int) -> int:\n\t\n        m, n, ans = len(mat), len(mat[0]), -inf\n        \n        fo
```\nclass Solution:\n    def maximumRows(self, mat: List[List[int]], cols: int) -> int:\n\t\n        m, n, ans = len(mat), len(mat[0]), -inf\n        \n        for comb in combinations(range(n),n-cols):\n        \n            ct = len(set(r for r in range(m) for c in comb if mat[r][c] == 1))\n\n            ans = max(ans,m-ct)\n\n        return ans\n```\n[https://leetcode.com/problems/maximum-rows-covered-by-columns/submissions/1287518760/](https://leetcode.com/problems/maximum-rows-covered-by-columns/submissions/1287518760/)\n\nI could be wrong, but I think that time complexity is *O*(*M*  * *N*^2) and space complexity is *O*(1), in which *N* ~ `m` and *N* ~ `n`.\n\n
['Python']