Word Pattern

Given a pattern string and a string s of single-space separated words, return true when the two follow the same one-to-one structure: the i-th word of s is always produced by the i-th character of pattern, every character always maps to the same word, and no two different characters map to the same word. Otherwise return false.

The number of pattern characters must equal the number of words.

Examples
Input: ["abba","dog cat cat dog"]
Output: true
Hints

Word Pattern

Given a pattern string and a string `s` of single-space separated words, return `true` when the two follow the same one-to-one structure: the i-th word of `s` is always produced by the i-th character of `pattern`, every character always maps to the same word, and no two different characters map to the same word. Otherwise return `false`.