My shortest Python Solution


  • -20
    J
    import re
    class Solution(object):
        def isMatch(self, s, p):
            # pattern = re.compile(s,re.DOTALL)
            p+="$"
            try:
                if re.match(p,s):
                    return True
                else:
                    return False
            except Exception as e:
                return False

  • 2
    T

    you are cheating!
    This is not algorithm


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.