あなたの友人は彼を入力している name
キーボードに。文字を入力するときに時々 、 c
、キーを得るかもしれない 長く押すと、文字が1回以上を入力します。
あなたは調べる typed
キーボードの文字が。返し True
、長押しされているいくつかの文字(おそらくなし)で、お友達の名前だった可能性がある場合。
例1:
Input: name = "alex", typed = "aaleex"
Output: true
Explanation: 'a' and 'e' in 'alex' were long pressed.
例2:
Input: name = "saeed", typed = "ssaaedd"
Output: false
Explanation: 'e' must have been pressed twice, but it wasn't in the typed output.
例3:
Input: name = "leelee", typed = "lleeelee"
Output: true
例4:
Input: name = "laiden", typed = "laiden"
Output: true
Explanation: It's not necessary to long press any character.
注意:
name.length <= 1000
typed.length <= 1000
- 文字
name
とはtyped
小文字です。
Githubの同期住所:
https://github.com/grandyang/leetcode/issues/925
同様のトピック:
参考文献: