My python solution, 62ms


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

Log in to reply
 

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