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 14a2041 commit 7775163Copy full SHA for 7775163
1 file changed
valid-palindrome/mrlee7.py
@@ -0,0 +1,7 @@
1
+import re
2
+
3
4
+class Solution:
5
+ def isPalindrome(self, s: str) -> bool:
6
+ result = re.sub(r'[^a-zA-Z0-9]', '', s).lower()
7
+ return result == result[::-1]
0 commit comments