1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-11 02:58:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (English)/变位词组(English) [group-anagrams-lcci].html

22 lines
705 B
HTML

<p>Write a method to sort an array of strings so that all the anagrams are in the same group.</p>
<p><b>Note:&nbsp;</b>This problem is slightly different from the original one the book.</p>
<p><strong>Example:</strong></p>
<pre>
<strong>Input:</strong> <code>[&quot;eat&quot;, &quot;tea&quot;, &quot;tan&quot;, &quot;ate&quot;, &quot;nat&quot;, &quot;bat&quot;]</code>,
<strong>Output:</strong>
[
[&quot;ate&quot;,&quot;eat&quot;,&quot;tea&quot;],
[&quot;nat&quot;,&quot;tan&quot;],
[&quot;bat&quot;]
]</pre>
<p><strong>Notes: </strong></p>
<ul>
<li>All inputs will be in lowercase.</li>
<li>The order of your output does not&nbsp;matter.</li>
</ul>