1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-12 02:41:42 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

批量更新数据

This commit is contained in:
2025-01-09 20:29:41 +08:00
parent 04ecea043d
commit 48cdd06c2b
5053 changed files with 156164 additions and 135322 deletions

View File

@@ -2,10 +2,10 @@
<ol>
<li><code>s</code>&nbsp;中选出 <strong>最小</strong>&nbsp;的字符,将它 <strong>接在</strong>&nbsp;结果字符串的后面。</li>
<li><code>s</code>&nbsp;剩余字符中选出&nbsp;<strong>最小</strong>&nbsp;的字符,且该字符比上一个添加的字符大,将它 <strong>接在</strong>&nbsp;结果字符串后面。</li>
<li><code>s</code> 剩余字符中选出比上一个添加字符更大的 <strong>最小</strong> 字符,将它 <strong>接在</strong>&nbsp;结果字符串后面。</li>
<li>重复步骤 2 ,直到你没法从 <code>s</code>&nbsp;中选择字符。</li>
<li><code>s</code>&nbsp;中选出 <strong>最大</strong>&nbsp;的字符,将它 <strong>接在</strong>&nbsp;结果字符串的后面。</li>
<li><code>s</code>&nbsp;剩余字符中选出&nbsp;<strong>最大</strong>&nbsp;字符,且该字符比上一个添加的字符小,将它 <strong>接在</strong>&nbsp;结果字符串后面。</li>
<li><code>s</code> 剩余字符中选出比上一个添加字符更小的 <strong>最大</strong>&nbsp;字符,将它 <strong>接在</strong>&nbsp;结果字符串后面。</li>
<li>重复步骤 5&nbsp;,直到你没法从 <code>s</code>&nbsp;中选择字符。</li>
<li>重复步骤 1 到 6 ,直到 <code>s</code>&nbsp;中所有字符都已经被选过。</li>
</ol>
@@ -18,38 +18,22 @@
<p><strong>示例 1</strong></p>
<pre><strong>输入:</strong>s = &quot;aaaabbbbcccc&quot;
<strong></strong>&quot;abccbaabccba&quot;
<strong>解释</strong>第一轮的步骤 123 后,结果字符串为 result = &quot;abc&quot;
第一轮的步骤 456 后,结果字符串为 result = &quot;abccba&quot;
第一轮结束,现在 s = &quot;aabbcc&quot; ,我们再次回到步骤 1
二轮的步骤 123 后,结果字符串为 result = &quot;abccbaabc&quot;
第二轮的步骤 456 后,结果字符串为 result = &quot;abccbaabccba&quot;
<pre>
<strong></strong>s = "aaaabbbbcccc"
<strong>输出</strong>"abccbaabccba"
<strong>解释:</strong>第一轮的步骤 123 后,结果字符串为 result = "abc"
第一轮的步骤 456 后,结果字符串为 result = "abccba"
一轮结束,现在 s = "aabbcc" ,我们再次回到步骤 1
第二轮的步骤 123 后,结果字符串为 result = "abccbaabc"
第二轮的步骤 456 后,结果字符串为 result = "abccbaabccba"
</pre>
<p><strong>示例 2</strong></p>
<pre><strong>输入:</strong>s = &quot;rat&quot;
<strong></strong>&quot;art&quot;
<strong>解释</strong>单词 &quot;rat&quot; 在上述算法重排序以后变成 &quot;art&quot;
</pre>
<p><strong>示例 3</strong></p>
<pre><strong>输入:</strong>s = &quot;leetcode&quot;
<strong>输出:</strong>&quot;cdelotee&quot;
</pre>
<p><strong>示例 4</strong></p>
<pre><strong>输入:</strong>s = &quot;ggggggg&quot;
<strong>输出:</strong>&quot;ggggggg&quot;
</pre>
<p><strong>示例 5</strong></p>
<pre><strong>输入:</strong>s = &quot;spo&quot;
<strong>输出:</strong>&quot;ops&quot;
<pre>
<strong></strong>s = "rat"
<strong>输出</strong>"art"
<strong>解释:</strong>单词 "rat" 在上述算法重排序以后变成 "art"
</pre>
<p>&nbsp;</p>