[LeetCode] 925ロングは長い名前に名前のキーを押しました



あなたの友人は彼を入力している  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.

注意:

  1. name.length <= 1000
  2. typed.length <= 1000
  3. 文字  name とは  typed 小文字です。



Githubの同期住所:

https://github.com/grandyang/leetcode/issues/925



同様のトピック:



参考文献:

https://leetcode.com/problems/long-pressed-name/



一つのトピックのLeetCodeすべてが(更新...)概要を説明します

おすすめ

転載: www.cnblogs.com/grandyang/p/11915230.html