https://leetcode.com/problems/valid-palindrome/
class Solution: def isPalindrome(self, s: str) -> bool: s = s.lower() s = [i for i in s if i.isalnum()] # isdigit, isalpha, isalnum(alphanumeric) return s[::-1] == s
时间复杂度:O() 空间复杂度:O()
回文类
Last updated 1 month ago