Python 4 lines Solution!!!


  • 2
    S

    class Solution(object):
    def isPalindrome(self, s):
    s=''.join([i.lower() for i in s if i.isalnum()])
    return s==s[::-1]


Log in to reply
 

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