F********9 发帖数: 44 | 1 Maximal Rectangle
Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle
containing all ones and return its area.
input output expected
["01","10"] 4 1
大伙觉得答案该是几? |
c*****a 发帖数: 808 | |
F********9 发帖数: 44 | 3 要包住两个'1',为啥不是4呢?
【在 c*****a 的大作中提到】 : 1
|
r*****e 发帖数: 146 | |
c*****a 发帖数: 808 | 5 01
10
这样是1
11
11
这样是4
110
110
000
这样还是4
10
10
10
10
这样也是4
你做了largest area in histogram了吗,做了就容易明白了 |
c********t 发帖数: 5706 | 6 01
10
里面只有两个矩形,面积都为1
rectangle
【在 F********9 的大作中提到】 : Maximal Rectangle : Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle : containing all ones and return its area. : input output expected : ["01","10"] 4 1 : 大伙觉得答案该是几?
|
F********9 发帖数: 44 | 7 明白了,得是连成一片的才算。
这样啊。 多谢各位筒子。 |