Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.
Analysis:需要结合Stack,进行压栈和出栈等操作。
最有技巧的一点就是利用Dynamic Programming, 统计在二维数组中连续一的个数。然后相似得使用
84. Largest Rectangle in Histogram 来统计面积。
Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.
Analysis:需要结合Stack,进行压栈和出栈等操作。
最有技巧的一点就是利用Dynamic Programming, 统计在二维数组中连续一的个数。然后相似得使用
84. Largest Rectangle in Histogram 来统计面积。