Easy
,Hash Table
,String
Given a pattern
and a string s
, find if s
follows the same pattern.
Here follow means a full match, such that there is a bijection between a letter in pattern
and a non-empty word in s
.
Example 1:
Example 2:
Example 3:
Constraints:
pattern.length
<= 300pattern
contains only lower-case English letters.s.length
<= 3000s
contains only lowercase English letters and spaces ' '
.s
does not contain any leading or trailing spaces.Yen-Chi ChenSun, Jan 1, 2023
看到樓上的一行超人,羞愧得差點不敢發…
MarsgoatSun, Jan 1, 2023
這才是一行好嗎= =
Yen-Chi ChenMon, Jan 1, 2023