class Solution:
def isPalindrome(self, s: str) -> bool:
str_new=''.join([c.lower() for c in s if c.isalnum()])
return str_new ==str_new[::-1]
class Solution:
def isPalindrome(self, s: str) -> bool:
left =0
right =len(s)-1
s=s.lower()
while left <right :
while left<right and not s[left].isalnum():
left +=1
while left<right and not s[right].isalnum():
right -=1
if s[left] != s[right] :
return False
left +=1
right -= 1
return True