class Solution:
def isPalindrome(self, s: str) -> bool:
s = s.lower()
i = 0
j = len(s) - 1
string = "abcdefghijklmnopqrstuvwxyz0123456789"
while(i < j):
if not(s[i].isalpha() or s[i].isdigit()):
i += 1
elif not(s[j].isalpha() or s[j].isdigit()):
j -= 1
else:
if s[i] != s[j]:
return False
else:
i += 1
j -= 1
return True
双指针法,没办法,不如a == a[::-1]好用