[LeetCode] Smallest Rectangle Enclosing Black Pixels

1 · · Feb. 14, 2022, 8:50 a.m.
302. Smallest Rectangle Enclosing Black Pixels You are given an m x n binary matrix image where 0 represents a white pixel and 1 represents a black pixel. The black pixels are connected (i.e., there is only one black region). Pixels are connected horizontally and vertically. Given two integers x and y that represents the location of one of the black pixels, return the area of the smallest (axis-aligned) rectangle that encloses all black pixels. You must write an algorithm with less than O(mn) r...