#3195

Find the Minimum Area to Cover All Ones I

pupil · 465 · lc medium +26 · 78.2% accepted · 491 likes · top 89%

Description

You are given a 2D binary array grid. Identify an axis-aligned rectangle of minimum area such that every cell containing 1 lies within the rectangle.

Return that minimum area.

Code

1
2
3