Tap here to switch tabs
Problem
Submissions

Problem: Largest Submatrix With Rearrangements

med
30 min
Try to solve the Largest Submatrix With Rearrangements problem.

Statement

You are given a binary matrix matrix of dimensions m $ imes$ n. You are permitted to rearrange the columns of matrix in any order.

Return the area of the largest submatrix consisting entirely of 11’s after reordering the columns.

Constraints:

  • m == matrix.length

  • n == matrix[i].length

  • 1≤1 \leq m * n ≤105\leq 10^5

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

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Largest Submatrix With Rearrangements

med
30 min
Try to solve the Largest Submatrix With Rearrangements problem.

Statement

You are given a binary matrix matrix of dimensions m $ imes$ n. You are permitted to rearrange the columns of matrix in any order.

Return the area of the largest submatrix consisting entirely of 11’s after reordering the columns.

Constraints:

  • m == matrix.length

  • n == matrix[i].length

  • 1≤1 \leq m * n ≤105\leq 10^5

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