leetcode925】的更多相关文章

Your friend is typing his name into a keyboard.  Sometimes, when typing a character c, the key might get long pressed, and the character will be typed 1 or more times. You examine the typed characters of the keyboard.  Return True if it is possible t…
public class Solution { public bool IsLongPressedName(string name, string typed) { var list1 = new List<KeyValuePair<char, int>>(); var list2 = new List<KeyValuePair<char, int>>(); int name_len = name.Length; int typed_len = typed.…
你的朋友正在使用键盘输入他的名字 name.偶尔,在键入字符 c 时,按键可能会被长按,而字符可能被输入 1 次或多次. 你将会检查键盘输入的字符 typed.如果它对应的可能是你的朋友的名字(其中一些字符可能被长按),那么就返回 True. 示例 1: 输入:name = "alex", typed = "aaleex" 输出:true 解释:'alex' 中的 'a' 和 'e' 被长按. 示例 2: 输入:name = "saeed", t…