← 返回 meta 的题目列表Validate Word Abbreviation With Numeric Substrings
类型:online_judge
meta
Given a string word and an abbreviation abbr, check if abbr is a valid abbreviation of word. Abbreviation is made by replacing any number of non-adjacent substrings in the string with their lengths. Leading zeros are not permitted in any numeric substring in the abbreviation. Example: word = "internationalization", abbr = "i12iz4n" should return true as it is a valid abbreviation. Implement a function to perform this check.
Example
Input
internationalization
i12iz4n