LeetCode1.5

作者: supermanwasd | 来源:发表于2019-01-05 22:28 被阅读0次

Regular Expression Matching

Screen Shot 2019-01-05 at 10.22.23 PM.png Screen Shot 2019-01-05 at 10.22.29 PM.png

class Solution:
    def isMatch(self, s, p):
        """
        :type s: str
        :type p: str
        :rtype: bool
        """
        if re.compile('^'+p+'$').match(s):
            return True
        return False

相关文章

网友评论

    本文标题:LeetCode1.5

    本文链接:https://www.haomeiwen.com/subject/hatjrqtx.html