We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a048d58 commit 4d07d50Copy full SHA for 4d07d50
valid-palindrome/oddong.py
@@ -0,0 +1,10 @@
1
+import re
2
+
3
+class Solution:
4
+ def isPalindrome(self, s: str) -> bool:
5
+ filtered_phrase = re.sub("[^a-zA-Z0-9]", "", s).lower()
6
7
+ if filtered_phrase == filtered_phrase[::-1]:
8
+ return True
9
+ else:
10
+ return False
0 commit comments