LeetCode刷题:85. Maximal Rectangle
原题链接:https://leetcode.com/problems/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:
Input:
[
["1","0","1","0","0"],
["1","0","1","1","1"],
["1","1","1","1","1"],
["1","0","0","1","0"]
]
Output: 6
题目的大意是:在一个给定的二维矩阵中,数组元素由0或者1组成,要找出一个由1构成的最大矩形使得面积最大。
在解答这道题目是,网上很多解法都参考了 LeetCode 84 题的解法。
LeetCode 84. Largest Rectangle in Histogram https://leetcode.com/problems/larg