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
PostgreSQLv16

Aquí aparecerá el resultado de la ejecución del código

Visible tests
1
Input
"A man, a plan, a canal: Panama"
ExpectedTrue
2
Input
"race a car"
ExpectedFalse
3
Input
" "
ExpectedTrue
4
Input
"0P"
ExpectedFalse
5
Input
"ab_a"
ExpectedTrue
6
Input
"A man, a plan, a canal: PanamaA man, a plan, a canal: Panama"
ExpectedTrue
Focus radio
Paused · SomaFM · Fluid