mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-01-10 18:48:13 +08:00
33 lines
849 B
HTML
33 lines
849 B
HTML
<p>给定两个字符串 <code>s</code> 和 <code>t</code> ,它们只包含小写字母。</p>
|
||
|
||
<p>字符串 <code>t</code> 由字符串 <code>s</code> 随机重排,然后在随机位置添加一个字母。</p>
|
||
|
||
<p>请找出在 <code>t</code> 中被添加的字母。</p>
|
||
|
||
<p> </p>
|
||
|
||
<p><strong>示例 1:</strong></p>
|
||
|
||
<pre>
|
||
<strong>输入:</strong>s = "abcd", t = "abcde"
|
||
<strong>输出:</strong>"e"
|
||
<strong>解释:</strong>'e' 是那个被添加的字母。
|
||
</pre>
|
||
|
||
<p><strong>示例 2:</strong></p>
|
||
|
||
<pre>
|
||
<strong>输入:</strong>s = "", t = "y"
|
||
<strong>输出:</strong>"y"
|
||
</pre>
|
||
|
||
<p> </p>
|
||
|
||
<p><strong>提示:</strong></p>
|
||
|
||
<ul>
|
||
<li><code>0 <= s.length <= 1000</code></li>
|
||
<li><code>t.length == s.length + 1</code></li>
|
||
<li><code>s</code> 和 <code>t</code> 只包含小写字母</li>
|
||
</ul>
|