Two-line Python solution using REGEXP, beats 99%


  • 0
    class Solution(object):
        def isPalindrome(self, s):
            check = "".join(re.findall("[a-zA-Z0-9]*", s)).lower()
            return check == check[::-1]

Log in to reply
 

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