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. 验证回文串
最新推荐文章于 2024-07-13 22:21:43 发布