Class Solution
java.lang.Object
g0701_0800.s0767_reorganize_string.Solution
767 - Reorganize String.<p>Medium</p>
<p>Given a string <code>s</code>, rearrange the characters of <code>s</code> so that any two adjacent characters are not the same.</p>
<p>Return <em>any possible rearrangement of</em> <code>s</code> <em>or return</em> <code>""</code> <em>if not possible</em>.</p>
<p><strong>Example 1:</strong></p>
<p><strong>Input:</strong> s = “aab”</p>
<p><strong>Output:</strong> “aba”</p>
<p><strong>Example 2:</strong></p>
<p><strong>Input:</strong> s = “aaab”</p>
<p><strong>Output:</strong> ""</p>
<p><strong>Constraints:</strong></p>
<ul>
<li><code>1 <= s.length <= 500</code></li>
<li><code>s</code> consists of lowercase English letters.</li>
</ul>
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Solution
public Solution()
-
-
Method Details
-
reorganizeString
-