Easy to understand Python solution


  • 0
    Z
    def isPalindrome(s):
        s = ''.join(re.findall('\w+', s)).lower()
        if s == s[::-1]:
            return True
        else:
            return False
    

Log in to reply
 

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