Leetcode: Day 134, #302 Smallest Rectangle Enclosing Black Pixels
Smallest Rectangle Enclosing Black Pixels An image is represented by a binary matrix with 0 1 as a black pixel. The black pixels are connected, i.e., there is only one black region. Pixels are connected horizontally and vertically. Given the location (x, y) of one of the black pixels, return the area of the smallest (axis-aligned) rectangle that encloses all black pixels. For example, given the following image: [ "0010", "0110", "0100" ] class Solution { public: int getTop(vectorRead full article from Leetcode: Day 134, #302 Smallest Rectangle Enclosing Black Pixels
No comments:
Post a Comment