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:
28
算法题(国内版)/problem (Chinese)/重构字符串 [reorganize-string].html
Normal file
28
算法题(国内版)/problem (Chinese)/重构字符串 [reorganize-string].html
Normal file
@@ -0,0 +1,28 @@
|
||||
<p>给定一个字符串 <code>s</code> ,检查是否能重新排布其中的字母,使得两相邻的字符不同。</p>
|
||||
|
||||
<p>返回<em> <code>s</code> 的任意可能的重新排列。若不可行,返回空字符串 <code>""</code></em> 。</p>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>示例 1:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>输入:</strong> s = "aab"
|
||||
<strong>输出:</strong> "aba"
|
||||
</pre>
|
||||
|
||||
<p><strong>示例 2:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>输入:</strong> s = "aaab"
|
||||
<strong>输出:</strong> ""
|
||||
</pre>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>提示:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li><code>1 <= s.length <= 500</code></li>
|
||||
<li><code>s</code> 只包含小写字母</li>
|
||||
</ul>
|
Reference in New Issue
Block a user