Python 2-line solution O(n):


#1

def isPalindrome(self, A):
a = (’’.join([i. for i in A if i.isalnum()])).lower()
return int(a == a[::-1])