Search⌘ K
AI Features

Solution: Smallest Rectangle Enclosing Black Pixels

Solution: Smallest Rectangle Enclosing Black Pixels gives a binary matrix and a known black pixel. Find the area of the smallest axis-aligned rectangle containing the connected black region without scanning every cell.

Statement

You are given an m×nm \times n binary matrix image, where 0 ...