mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-13 19:31:42 +08:00
add leetcode problem-cn part3
This commit is contained in:
23
算法题(国内版)/problem (Chinese)/最大交换 [maximum-swap].html
Normal file
23
算法题(国内版)/problem (Chinese)/最大交换 [maximum-swap].html
Normal file
@@ -0,0 +1,23 @@
|
||||
<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>
|
Reference in New Issue
Block a user