Tap here to switch tabs
Problem
Submissions

Problem: Find the Minimum Area to Cover All Ones I

med
30 min
Try to solve the Find the Minimum Area to Cover All Ones I problem.

Statement

You are given a 2extD2 ext{D} binary array grid. Find the minimum area of a rectangle with sides parallel to the grid edges that encloses all cells with a value of 11.

Constraints:

  • 1≤1 \leq grid.length, grid[i].length ≤1000\leq 1000

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

  • The input is generated such that there is at least one 11 in grid.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Find the Minimum Area to Cover All Ones I

med
30 min
Try to solve the Find the Minimum Area to Cover All Ones I problem.

Statement

You are given a 2extD2 ext{D} binary array grid. Find the minimum area of a rectangle with sides parallel to the grid edges that encloses all cells with a value of 11.

Constraints:

  • 1≤1 \leq grid.length, grid[i].length ≤1000\leq 1000

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

  • The input is generated such that there is at least one 11 in grid.