1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-10-13 01:15:14 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
Files
leetcode-problemset/leetcode-cn/problem (Chinese)/字母异位词分组 [group-anagrams].html
2025-09-29 14:43:44 +08:00

46 lines
1.4 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<p>给你一个字符串数组,请你将 <span data-keyword="anagram">字母异位词</span> 组合在一起。可以按任意顺序返回结果列表。</p>
<p>&nbsp;</p>
<p><strong>示例 1:</strong></p>
<div class="example-block">
<p><strong>输入:</strong> strs = ["eat", "tea", "tan", "ate", "nat", "bat"]</p>
<p><strong>输出: </strong>[["bat"],["nat","tan"],["ate","eat","tea"]]</p>
<p><strong>解释:</strong></p>
<ul>
<li>在 strs 中没有字符串可以通过重新排列来形成 <code>"bat"</code></li>
<li>字符串 <code>"nat"</code><code>"tan"</code> 是字母异位词,因为它们可以重新排列以形成彼此。</li>
<li>字符串 <code>"ate"</code>&nbsp;<code>"eat"</code>&nbsp;<code>"tea"</code> 是字母异位词,因为它们可以重新排列以形成彼此。</li>
</ul>
</div>
<p><strong>示例 2:</strong></p>
<div class="example-block">
<p><strong>输入:</strong> strs = [""]</p>
<p><strong>输出: </strong>[[""]]</p>
</div>
<p><strong>示例 3:</strong></p>
<div class="example-block">
<p><strong>输入:</strong> strs = ["a"]</p>
<p><strong>输出: </strong>[["a"]]</p>
</div>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= strs.length &lt;= 10<sup>4</sup></code></li>
<li><code>0 &lt;= strs[i].length &lt;= 100</code></li>
<li><code>strs[i]</code>&nbsp;仅包含小写字母</li>
</ul>