desc.html 1.4 KB
Newer Older
每日一练社区's avatar
每日一练社区 已提交
1
<p>给定一个仅包含 <code>0</code><code>1</code> 、大小为 <code>rows x cols</code> 的二维二进制矩阵,找出只包含 <code>1</code> 的最大矩形,并返回其面积。</p><p> </p><p><strong>示例 1:</strong></p><img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0000-0099/0085.Maximal%20Rectangle/images/maximal.jpg" style="width: 402px; height: 322px;" /><pre><strong>输入:</strong>matrix = [["1","0","1","0","0"],["1","0","1","1","1"],["1","1","1","1","1"],["1","0","0","1","0"]]<strong><br />输出:</strong>6<strong><br />解释:</strong>最大矩形如上图所示。</pre><p><strong>示例 2:</strong></p><pre><strong>输入:</strong>matrix = []<strong><br />输出:</strong>0</pre><p><strong>示例 3:</strong></p><pre><strong>输入:</strong>matrix = [["0"]]<strong><br />输出:</strong>0</pre><p><strong>示例 4:</strong></p><pre><strong>输入:</strong>matrix = [["1"]]<strong><br />输出:</strong>1</pre><p><strong>示例 5:</strong></p><pre><strong>输入:</strong>matrix = [["0","0"]]<strong><br />输出:</strong>0</pre><p> </p><p><strong>提示:</strong></p><ul>	<li><code>rows == matrix.length</code></li>	<li><code>cols == matrix[0].length</code></li>	<li><code>0 <= row, cols <= 200</code></li>	<li><code>matrix[i][j]</code><code>'0'</code><code>'1'</code></li></ul>