Maximal Rectangle
Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area.
Example:
分析
用max histogram 的方法,一层层row的高度叠加作为heights数组
注意heights数组弹出一次后,可能为0,要判断。
Last updated
Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area.
Example:
分析
用max histogram 的方法,一层层row的高度叠加作为heights数组
注意heights数组弹出一次后,可能为0,要判断。
Last updated