题目描述:
Given a pattern
and a string str
, find if str
follows the same pattern.
Examples:
pattern = "abba
", str = "dog cat cat dog
" should return true.
pattern = "abba
", str = "dog cat cat fish ...
Given a pattern
and a string str
, find if str
follows the same pattern.
Examples:
pattern = "abba
", str = "dog cat cat dog
" should return true.
pattern = "abba
", str = "dog cat cat fish ...