Given a pattern string *pattern* and a sentence *s* (a string of words separated by spaces), return `true` if *s* follows the same pattern. Here *s* follows the pattern if there is a bijection between a letter in *pattern* and a word in *s*. Return `false` otherwise.
pattern = "pattern", s = "sentence string"
boolean (true/false)
Example 1:
Input:
pattern = "abba" s = "dog cat cat dog"
Output:
true
Explanation:
a->dog, b->cat is a valid mapping.
Example 2:
Input:
pattern = "abba" s = "dog cat cat fish"
Output:
false
Explanation:
Mapping would require a->dog, b->cat, but fish does not match.