<div><p>Given a string <code>S</code>, check if the letters can be rearranged so that two characters that are adjacent to each other are not the same.</p>
<p>If possible, output any possible result. If not possible, return the empty string.</p>
<p><strong>Example 1:</strong></p>
<pre><strong>Input:</strong> S = "aab"
<strong>Output:</strong> "aba"
</pre>
<p><strong>Example 2:</strong></p>
<pre><strong>Input:</strong> S = "aaab"
<strong>Output:</strong> ""
</pre>
<p><strong>Note:</strong></p>
<ul>
<li><code>S</code> will consist of lowercase letters and have length in range <code>[1, 500]</code>.</li>
</ul>
<p> </p>
</div>