2397. Maximum Rows Covered by Columns
You are given a 0-indexed m x n binary matrix mat and an integer cols, which denotes the number of columns you must choose.
A row is covered by a set of columns if each cell in the row that has a value of 1 also lies in one of the columns of the chosen set.
Return the maximum number of rows that can be covered by a set of cols columns.
c++
1 | class Solution { |