Leetcode-925 Long Pressed Name(長按鍵入)
阿新 • • 發佈:2018-10-23
按鍵 spa isl etc nbsp leet col als color
1 class Solution 2 { 3 public://saeed ssaaedd 4 bool isLongPressedName(string name, string typed) 5 { 6 int typedEnd = 0; 7 for(int i = 0;i < name.size();i ++) 8 { 9 while(typedEnd < typed.size() && name[i]!=typed[typedEnd])10 typedEnd ++; 11 12 if(typedEnd >= typed.size()) 13 return false; 14 15 typedEnd ++; 16 } 17 return true; 18 } 19 };
Leetcode-925 Long Pressed Name(長按鍵入)