290. Word Pattern

xiaoxiao2021-02-28  52

class Solution(object):     def wordPattern(self, pattern, str):         """         :type pattern: str         :type str: str         :rtype: bool         """         s = pattern         t = str.split()

        return map(s.find, s) == map(t.index, t)

https://leetcode.com/submissions/detail/105273745/

转载请注明原文地址: https://www.6miu.com/read-62112.html

最新回复(0)