class Solution:
def isPalindrome(self, s):
"""
:type s: str
:rtype: bool
"""
s = list(filter(str.isalnum, s.lower()))
return True if s == s[::-1] else False
125. 验证回文串
最新推荐文章于 2023-03-15 10:19:47 发布