mirror of
				https://gitee.com/coder-xiaomo/leetcode-problemset
				synced 2025-11-04 03:33:12 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			24 lines
		
	
	
		
			560 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			560 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
<p>给定一个非负整数,你<strong>至多</strong>可以交换一次数字中的任意两位。返回你能得到的最大值。</p>
 | 
						|
 | 
						|
<p><strong>示例 1 :</strong></p>
 | 
						|
 | 
						|
<pre>
 | 
						|
<strong>输入:</strong> 2736
 | 
						|
<strong>输出:</strong> 7236
 | 
						|
<strong>解释:</strong> 交换数字2和数字7。
 | 
						|
</pre>
 | 
						|
 | 
						|
<p><strong>示例 2 :</strong></p>
 | 
						|
 | 
						|
<pre>
 | 
						|
<strong>输入:</strong> 9973
 | 
						|
<strong>输出:</strong> 9973
 | 
						|
<strong>解释:</strong> 不需要交换。
 | 
						|
</pre>
 | 
						|
 | 
						|
<p><strong>注意:</strong></p>
 | 
						|
 | 
						|
<ol>
 | 
						|
	<li>给定数字的范围是 [0, 10<sup>8</sup>]</li>
 | 
						|
</ol>
 |