Pretty Python Solution


  • 0
    class Solution(object):
        def isPalindrome(self, s):
            s = list(s)
            alpha_list = []
            for i in range(len(s)):
                if s[i].isalnum():
                    alpha_list.append(s[i].lower())
            return alpha_list == list(reversed(alpha_list))
    

Log in to reply
 

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