Simple python solution better than 96%


  • 0
    M

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


Log in to reply
 

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