mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-01-11 02:58:13 +08:00
39 lines
1.3 KiB
HTML
39 lines
1.3 KiB
HTML
<p>给定一个字符串数组 <code>strs</code> ,将 <strong>变位词 </strong>组合在一起。 可以按任意顺序返回结果列表。</p>
|
|
|
|
<p><strong>注意:</strong>若两个字符串中每个字符出现的次数都相同,则称它们互为变位词。</p>
|
|
|
|
<p> </p>
|
|
|
|
<p><strong>示例 1:</strong></p>
|
|
|
|
<pre>
|
|
<strong>输入:</strong> strs = <code>["eat", "tea", "tan", "ate", "nat", "bat"]</code>
|
|
<strong>输出: </strong>[["bat"],["nat","tan"],["ate","eat","tea"]]</pre>
|
|
|
|
<p><strong>示例 2:</strong></p>
|
|
|
|
<pre>
|
|
<strong>输入:</strong> strs = <code>[""]</code>
|
|
<strong>输出: </strong>[[""]]
|
|
</pre>
|
|
|
|
<p><strong>示例 3:</strong></p>
|
|
|
|
<pre>
|
|
<strong>输入:</strong> strs = <code>["a"]</code>
|
|
<strong>输出: </strong>[["a"]]</pre>
|
|
|
|
<p> </p>
|
|
|
|
<p><strong>提示:</strong></p>
|
|
|
|
<ul>
|
|
<li><code>1 <= strs.length <= 10<sup>4</sup></code></li>
|
|
<li><code>0 <= strs[i].length <= 100</code></li>
|
|
<li><code>strs[i]</code> 仅包含小写字母</li>
|
|
</ul>
|
|
|
|
<p> </p>
|
|
|
|
<p><meta charset="UTF-8" />注意:本题与主站 49 题相同: <a href="https://leetcode-cn.com/problems/group-anagrams/">https://leetcode-cn.com/problems/group-anagrams/</a></p>
|