1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-13 19:31:42 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

add leetcode problem-cn part2

This commit is contained in:
2022-03-27 20:38:29 +08:00
parent 5a4fa6db12
commit 0fc7f4b734
1617 changed files with 134637 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
<p>给定两个字符串 <code>s</code><code>t</code> ,编写一个函数来判断它们是不是一组变位词(字母异位词)。</p>
<p><strong>注意:</strong>&nbsp;<code><em>s</em></code><code><em>t</em></code><em>&nbsp;</em>中每个字符出现的次数都相同且<strong>字符顺序不完全相同</strong>,则称&nbsp;<code><em>s</em></code><code><em>t</em></code><em>&nbsp;</em>互为变位词(字母异位词)。</p>
<p>&nbsp;</p>
<p><strong>示例&nbsp;1:</strong></p>
<pre>
<strong>输入:</strong> s = &quot;anagram&quot;, t = &quot;nagaram&quot;
<strong>输出:</strong> true
</pre>
<p><strong>示例 2:</strong></p>
<pre>
<strong>输入:</strong> s = &quot;rat&quot;, t = &quot;car&quot;
<strong>输出: </strong>false</pre>
<p><strong>示例 3:</strong></p>
<pre>
<strong>输入:</strong> s = &quot;a&quot;, t = &quot;a&quot;
<strong>输出: </strong>false</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= s.length, t.length &lt;= 5 * 10<sup>4</sup></code></li>
<li><code>s</code>&nbsp;and&nbsp;<code>t</code>&nbsp;仅包含小写字母</li>
</ul>
<p>&nbsp;</p>
<p><strong>进阶:&nbsp;</strong>如果输入字符串包含 unicode 字符怎么办?你能否调整你的解法来应对这种情况?</p>
<p>&nbsp;</p>
<p><meta charset="UTF-8" />注意:本题与主站 242&nbsp;题相似(字母异位词定义不同):<a href="https://leetcode-cn.com/problems/valid-anagram/">https://leetcode-cn.com/problems/valid-anagram/</a></p>