1
class Solution(object):
2
def wordPattern(self, pattern, s):
3
"""
4
:type pattern: str
5
:type s: str
6
:rtype: bool
7
"""
8
p, s = list(pattern), list(s.split(" "))
9

10
return len(s) == len(p) and len(set(zip(p, s))) == len(set(s)) == len(set(p))

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0