Clean Palindrome
A palindrome reads the same forward and backward after ignoring anything that should not count. Given a string s, consider only letters and digits, and ignore uppercase versus lowercase. Return True if the cleaned string is a palindrome.
Примеры
Ввод
"A man, a plan, a canal: Panama"Вывод
TrueВвод
"race a car"Вывод
FalseВвод
" "Вывод
TrueНужно реализовать
def is_palindrome(s: str) -> bool:
Теги
stringstwo-pointers
Συνδεθείτε για να δείτε το ιστορικό υποβολών
ΣύνδεσηΣυνδεθείτε για να χρησιμοποιήσετε τον AI Mentor
ΣύνδεσηTests12
Visible tests
Κρυφό τεστ 7
Κρυφό τεστ 8
Κρυφό τεστ 9
Κρυφό τεστ 10
Κρυφό τεστ 11
Κρυφό τεστ 12
They run when you press "Submit" — your whole solution is checked against them so you can't hard-code answers for the visible cases.
Focus radio
Paused · SomaFM · Fluid