1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-27 02:30:28 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/找不同 [find-the-difference].html

33 lines
849 B
HTML
Raw Normal View History

2022-03-27 20:56:26 +08:00
<p>给定两个字符串 <code>s</code><code>t</code>&nbsp;,它们只包含小写字母。</p>
<p>字符串 <code>t</code>&nbsp;由字符串 <code>s</code> 随机重排,然后在随机位置添加一个字母。</p>
<p>请找出在 <code>t</code>&nbsp;中被添加的字母。</p>
<p>&nbsp;</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>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>0 &lt;= s.length &lt;= 1000</code></li>
<li><code>t.length == s.length + 1</code></li>
<li><code>s</code><code>t</code> 只包含小写字母</li>
</ul>