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

add leetcode problem-cn part3

This commit is contained in:
2022-03-27 20:46:41 +08:00
parent 6dafca13c5
commit dfacb20d31
1385 changed files with 115239 additions and 3 deletions

View File

@@ -0,0 +1,30 @@
<p>你的朋友正在使用键盘输入他的名字&nbsp;<code>name</code>。偶尔,在键入字符&nbsp;<code>c</code>&nbsp;时,按键可能会被<em>长按</em>,而字符可能被输入 1 次或多次。</p>
<p>你将会检查键盘输入的字符&nbsp;<code>typed</code>。如果它对应的可能是你的朋友的名字(其中一些字符可能被长按),那么就返回&nbsp;<code>True</code></p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<pre>
<strong>输入:</strong>name = "alex", typed = "aaleex"
<strong>输出:</strong>true
<strong>解释:</strong>'alex' 中的 'a' 和 'e' 被长按。
</pre>
<p><strong>示例 2</strong></p>
<pre>
<strong>输入:</strong>name = "saeed", typed = "ssaaedd"
<strong>输出:</strong>false
<strong>解释:</strong>'e' 一定需要被键入两次,但在 typed 的输出中不是这样。
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= name.length, typed.length &lt;= 1000</code></li>
<li><code>name</code>&nbsp;<code>typed</code>&nbsp;的字符都是小写字母</li>
</ul>