mirror of
				https://gitee.com/coder-xiaomo/leetcode-problemset
				synced 2025-11-04 11:43:12 +08:00 
			
		
		
		
	国外版
This commit is contained in:
		
							
								
								
									
										33
									
								
								算法题(国外版)/maximal-square.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								算法题(国外版)/maximal-square.html
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,33 @@
 | 
			
		||||
<p>Given an <code>m x n</code> binary <code>matrix</code> filled with <code>0</code>'s and <code>1</code>'s, <em>find the largest square containing only</em> <code>1</code>'s <em>and return its area</em>.</p>
 | 
			
		||||
 | 
			
		||||
<p> </p>
 | 
			
		||||
<p><strong>Example 1:</strong></p>
 | 
			
		||||
<img alt="" src="https://assets.leetcode.com/uploads/2020/11/26/max1grid.jpg" style="width: 400px; height: 319px;" />
 | 
			
		||||
<pre>
 | 
			
		||||
<strong>Input:</strong> matrix = [["1","0","1","0","0"],["1","0","1","1","1"],["1","1","1","1","1"],["1","0","0","1","0"]]
 | 
			
		||||
<strong>Output:</strong> 4
 | 
			
		||||
</pre>
 | 
			
		||||
 | 
			
		||||
<p><strong>Example 2:</strong></p>
 | 
			
		||||
<img alt="" src="https://assets.leetcode.com/uploads/2020/11/26/max2grid.jpg" style="width: 165px; height: 165px;" />
 | 
			
		||||
<pre>
 | 
			
		||||
<strong>Input:</strong> matrix = [["0","1"],["1","0"]]
 | 
			
		||||
<strong>Output:</strong> 1
 | 
			
		||||
</pre>
 | 
			
		||||
 | 
			
		||||
<p><strong>Example 3:</strong></p>
 | 
			
		||||
 | 
			
		||||
<pre>
 | 
			
		||||
<strong>Input:</strong> matrix = [["0"]]
 | 
			
		||||
<strong>Output:</strong> 0
 | 
			
		||||
</pre>
 | 
			
		||||
 | 
			
		||||
<p> </p>
 | 
			
		||||
<p><strong>Constraints:</strong></p>
 | 
			
		||||
 | 
			
		||||
<ul>
 | 
			
		||||
	<li><code>m == matrix.length</code></li>
 | 
			
		||||
	<li><code>n == matrix[i].length</code></li>
 | 
			
		||||
	<li><code>1 <= m, n <= 300</code></li>
 | 
			
		||||
	<li><code>matrix[i][j]</code> is <code>'0'</code> or <code>'1'</code>.</li>
 | 
			
		||||
</ul>
 | 
			
		||||
		Reference in New Issue
	
	Block a user