Tap here to switch tabs
Problem
Submissions

Problem: Maximum Rows Covered by Columns

med
30 min
Try to solve the Maximum Rows Covered by Columns problem.

Statement

You are given an m $ imes$ n binary matrix matrix and an integer numSelect, which represents the number of distinct columns you must select.

A row is considered covered if all indices j where matrix[i][j] =1= 1 are among the chosen columns. In other words, a row is covered if every cell in that row containing a 11 belongs to the selected set of columns.

Return the maximum number of rows that can be covered by choosing exactly numSelect distinct columns.

Constraints:

  • m ==== matrix.length

  • n ==== matrix[i].length

  • 1≤1 \leq m, n ≤12\leq 12

  • matrix[i][j] is either 00 or 11.

  • 1≤1 \leq numSelect ≤\leq n

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximum Rows Covered by Columns

med
30 min
Try to solve the Maximum Rows Covered by Columns problem.

Statement

You are given an m $ imes$ n binary matrix matrix and an integer numSelect, which represents the number of distinct columns you must select.

A row is considered covered if all indices j where matrix[i][j] =1= 1 are among the chosen columns. In other words, a row is covered if every cell in that row containing a 11 belongs to the selected set of columns.

Return the maximum number of rows that can be covered by choosing exactly numSelect distinct columns.

Constraints:

  • m ==== matrix.length

  • n ==== matrix[i].length

  • 1≤1 \leq m, n ≤12\leq 12

  • matrix[i][j] is either 00 or 11.

  • 1≤1 \leq numSelect ≤\leq n