mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-12 02:41:42 +08:00
批量更新数据
This commit is contained in:
@@ -2,10 +2,10 @@
|
||||
|
||||
<ol>
|
||||
<li>从 <code>s</code> 中选出 <strong>最小</strong> 的字符,将它 <strong>接在</strong> 结果字符串的后面。</li>
|
||||
<li>从 <code>s</code> 剩余字符中选出 <strong>最小</strong> 的字符,且该字符比上一个添加的字符大,将它 <strong>接在</strong> 结果字符串后面。</li>
|
||||
<li>从 <code>s</code> 剩余字符中选出比上一个添加字符更大的 <strong>最小</strong> 字符,将它 <strong>接在</strong> 结果字符串后面。</li>
|
||||
<li>重复步骤 2 ,直到你没法从 <code>s</code> 中选择字符。</li>
|
||||
<li>从 <code>s</code> 中选出 <strong>最大</strong> 的字符,将它 <strong>接在</strong> 结果字符串的后面。</li>
|
||||
<li>从 <code>s</code> 剩余字符中选出 <strong>最大</strong> 的字符,且该字符比上一个添加的字符小,将它 <strong>接在</strong> 结果字符串后面。</li>
|
||||
<li>从 <code>s</code> 剩余字符中选出比上一个添加字符更小的 <strong>最大</strong> 字符,将它 <strong>接在</strong> 结果字符串后面。</li>
|
||||
<li>重复步骤 5 ,直到你没法从 <code>s</code> 中选择字符。</li>
|
||||
<li>重复步骤 1 到 6 ,直到 <code>s</code> 中所有字符都已经被选过。</li>
|
||||
</ol>
|
||||
@@ -18,38 +18,22 @@
|
||||
|
||||
<p><strong>示例 1:</strong></p>
|
||||
|
||||
<pre><strong>输入:</strong>s = "aaaabbbbcccc"
|
||||
<strong>输出:</strong>"abccbaabccba"
|
||||
<strong>解释:</strong>第一轮的步骤 1,2,3 后,结果字符串为 result = "abc"
|
||||
第一轮的步骤 4,5,6 后,结果字符串为 result = "abccba"
|
||||
第一轮结束,现在 s = "aabbcc" ,我们再次回到步骤 1
|
||||
第二轮的步骤 1,2,3 后,结果字符串为 result = "abccbaabc"
|
||||
第二轮的步骤 4,5,6 后,结果字符串为 result = "abccbaabccba"
|
||||
<pre>
|
||||
<strong>输入:</strong>s = "aaaabbbbcccc"
|
||||
<strong>输出:</strong>"abccbaabccba"
|
||||
<strong>解释:</strong>第一轮的步骤 1,2,3 后,结果字符串为 result = "abc"
|
||||
第一轮的步骤 4,5,6 后,结果字符串为 result = "abccba"
|
||||
第一轮结束,现在 s = "aabbcc" ,我们再次回到步骤 1
|
||||
第二轮的步骤 1,2,3 后,结果字符串为 result = "abccbaabc"
|
||||
第二轮的步骤 4,5,6 后,结果字符串为 result = "abccbaabccba"
|
||||
</pre>
|
||||
|
||||
<p><strong>示例 2:</strong></p>
|
||||
|
||||
<pre><strong>输入:</strong>s = "rat"
|
||||
<strong>输出:</strong>"art"
|
||||
<strong>解释:</strong>单词 "rat" 在上述算法重排序以后变成 "art"
|
||||
</pre>
|
||||
|
||||
<p><strong>示例 3:</strong></p>
|
||||
|
||||
<pre><strong>输入:</strong>s = "leetcode"
|
||||
<strong>输出:</strong>"cdelotee"
|
||||
</pre>
|
||||
|
||||
<p><strong>示例 4:</strong></p>
|
||||
|
||||
<pre><strong>输入:</strong>s = "ggggggg"
|
||||
<strong>输出:</strong>"ggggggg"
|
||||
</pre>
|
||||
|
||||
<p><strong>示例 5:</strong></p>
|
||||
|
||||
<pre><strong>输入:</strong>s = "spo"
|
||||
<strong>输出:</strong>"ops"
|
||||
<pre>
|
||||
<strong>输入:</strong>s = "rat"
|
||||
<strong>输出:</strong>"art"
|
||||
<strong>解释:</strong>单词 "rat" 在上述算法重排序以后变成 "art"
|
||||
</pre>
|
||||
|
||||
<p> </p>
|
||||
|
Reference in New Issue
Block a user