pythonic 2-liner


  • 0
        def isPalindrome(self, s):
            """
            :type s: str
            :rtype: bool
            """
            tmp = ''.join(re.findall('[0-9a-z]', s.lower()))
            return tmp == tmp[::-1]
    

Log in to reply
 

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