classSolution: defisPalindrome(self, s: str) -> bool: i, j = 0, len(s) - 1 while i < j: while i < len(s) andnot s[i].isalnum(): i += 1 while j > -1andnot s[j].isalnum(): j -= 1 if i > j: returnTrue if s[i].upper() != s[j].upper(): returnFalse else: i += 1 j -= 1 returnTrue