Given a non-empty string s and an abbreviation abbr, return whether the string matches with the given abbreviation.
["word", "1ord", "w1rd", "wo1d", "wor1", "2rd", "w2d", "wo2", "1o1d",
"1or1", "w1r1", "1o2", "2r1", "3d", "w3", "4"]
Notice that only the above abbreviations are valid abbreviations of the string "word". Any other string is not a valid abbreviation of "word".
Given s = "internationalization", abbr = "i12iz4n":
Return true.
Given s = "apple", abbr = "a2e":
Return false.
基本思路还是双指针分别指向两string,然后 linear scan。如果在abbr中遇到数字,则继续读出所有数字,然后令指向word的指针右移相应位数,否则比较左右指针指向的字母是否相同。要注意数字的第一位不能为0.