Skip to content

Latest commit

 

History

History
45 lines (27 loc) · 1018 Bytes

File metadata and controls

45 lines (27 loc) · 1018 Bytes

中文文档

Description

An image is represented by a binary matrix with 0 as a white pixel and 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.

Example:

Input:
[
  "0010",
  "0110",
  "0100"
]
and x = 0, y = 2

Output: 6

Solutions

Python3

Java

...