Tap here to switch tabs
Problem
Submissions

Problem: Find the Minimum Area to Cover All Ones I

Find the Minimum Area to Cover All Ones I gives a binary grid and asks for the smallest axis-aligned rectangle that contains every cell holding a one. Return its area.

Statement

You are given a 2D2 {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

Find the Minimum Area to Cover All Ones I gives a binary grid and asks for the smallest axis-aligned rectangle that contains every cell holding a one. Return its area.

Statement

You are given a 2D2 {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.