mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-01-10 18:48:13 +08:00
23 lines
662 B
HTML
23 lines
662 B
HTML
<p>给定两个由小写字母组成的字符串 <code>s1</code> 和 <code>s2</code>,请编写一个程序,确定其中一个字符串的字符重新排列后,能否变成另一个字符串。</p>
|
||
|
||
<p><strong>示例 1:</strong></p>
|
||
|
||
<pre>
|
||
<strong>输入:</strong> <code>s1</code> = "abc", <code>s2</code> = "bca"
|
||
<strong>输出:</strong> true
|
||
</pre>
|
||
|
||
<p><strong>示例 2:</strong></p>
|
||
|
||
<pre>
|
||
<strong>输入:</strong> <code>s1</code> = "abc", <code>s2</code> = "bad"
|
||
<strong>输出:</strong> false
|
||
</pre>
|
||
|
||
<p><strong>说明:</strong></p>
|
||
|
||
<ul>
|
||
<li><code>0 <= len(s1) <= 100 </code></li>
|
||
<li><code>0 <= len(s2) <= 100 </code></li>
|
||
</ul>
|