1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-10-18 19:46:47 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2022-03-29 12:43:11 +08:00
parent 58bbdfd57c
commit 2b0511d272
10721 changed files with 8123 additions and 8119 deletions

View File

@@ -0,0 +1,27 @@
<p>给你一个正整数 <code>n</code> ,请你找出符合条件的最小整数,其由重新排列 <code>n</code><strong> </strong>中存在的每位数字组成,并且其值大于 <code>n</code> 。如果不存在这样的正整数,则返回 <code>-1</code></p>
<p><strong>注意</strong> ,返回的整数应当是一个 <strong>32 位整数</strong> ,如果存在满足题意的答案,但不是 <strong>32 位整数</strong> ,同样返回 <code>-1</code></p>
<p> </p>
<p><strong>示例 1</strong></p>
<pre>
<strong>输入:</strong>n = 12
<strong>输出:</strong>21
</pre>
<p><strong>示例 2</strong></p>
<pre>
<strong>输入:</strong>n = 21
<strong>输出:</strong>-1
</pre>
<p> </p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 <= n <= 2<sup>31</sup> - 1</code></li>
</ul>