|
Determine if a given pattern matches a string using backtracking. |
Determine if a given pattern matches a string using backtracking.
pattern: The pattern to match. input_string: The string to match against the pattern. return: True if the pattern matches the string, False otherwise.
>>> match_word_pattern("aba", "GraphTreesGraph")
True
>>> match_word_pattern("xyx", "PythonRubyPython")
True
>>> match_word_pattern("GG", "PythonJavaPython")
False