← 返回 meta 的题目列表Pattern Matching
类型:online_judge
meta
Given two strings, one is the input string and the other is the pattern. Write a function to determine if the pattern matches the input. The pattern can contain a digit k, which means the preceding character can be repeated k times. For example, given input "foo" and pattern "f2o", return true because the pattern matches foo. Note that the pattern only includes paired characters and digits without more complex expressions.
Input
Input string input: A string with length up to 1000.
Pattern string pattern
Output
Boolean value indicating whether the input matches the pattern.
Example
Input
"foo", "f2o"