mirror of
				https://gitee.com/coder-xiaomo/leetcode-problemset
				synced 2025-11-04 03:33:12 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			45 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			45 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
<p>给定 <code>m x n</code> 矩阵 <code>matrix</code> 。</p>
 | 
						||
 | 
						||
<p>你可以从中选出任意数量的列并翻转其上的 <strong>每个 </strong>单元格。(即翻转后,单元格的值从 <code>0</code> 变成 <code>1</code>,或者从 <code>1</code> 变为 <code>0</code> 。)</p>
 | 
						||
 | 
						||
<p>返回 <em>经过一些翻转后,行与行之间所有值都相等的最大行数</em> 。</p>
 | 
						||
 | 
						||
<p> </p>
 | 
						||
 | 
						||
<ol>
 | 
						||
</ol>
 | 
						||
 | 
						||
<p><strong>示例 1:</strong></p>
 | 
						||
 | 
						||
<pre>
 | 
						||
<strong>输入:</strong>matrix = [[0,1],[1,1]]
 | 
						||
<strong>输出:</strong>1
 | 
						||
<strong>解释:</strong>不进行翻转,有 1 行所有值都相等。
 | 
						||
</pre>
 | 
						||
 | 
						||
<p><strong>示例 2:</strong></p>
 | 
						||
 | 
						||
<pre>
 | 
						||
<strong>输入:</strong>matrix = [[0,1],[1,0]]
 | 
						||
<strong>输出:</strong>2
 | 
						||
<strong>解释:</strong>翻转第一列的值之后,这两行都由相等的值组成。
 | 
						||
</pre>
 | 
						||
 | 
						||
<p><strong>示例 3:</strong></p>
 | 
						||
 | 
						||
<pre>
 | 
						||
<strong>输入:</strong>matrix = [[0,0,0],[0,0,1],[1,1,0]]
 | 
						||
<strong>输出:</strong>2
 | 
						||
<strong>解释:</strong>翻转前两列的值之后,后两行由相等的值组成。</pre>
 | 
						||
 | 
						||
<p> </p>
 | 
						||
 | 
						||
<p><strong>提示:</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] == 0</code> 或 <code>1</code></li>
 | 
						||
</ul>
 |