Easy Python Solution


  • 0
    A
    class Solution:
        def isPalindrome(self, s):
            """
            :type s: str
            :rtype: bool
            """
            if not s:
                return True
            s = ''.join(filter(lambda c: c.isalnum(), s)).lower()
            return s == s[::-1]
    

Log in to reply
 

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