https://leetcode-cn.com/problems/valid-palindrome/
class Solution: def isPalindrome(self, s: str) -> bool: #将s过滤,只保留数字和字母,再转为小写 s = ''.join(filter(str.isalnum, s)).lower() #检查对称 return s == s[::-1]
最后更新于5年前