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 b89edee commit 0c21985Copy full SHA for 0c21985
valid-palindrome/jungsiroo.py
@@ -0,0 +1,7 @@
1
+import re
2
+
3
+class Solution:
4
+ def isPalindrome(self, s: str) -> bool:
5
+ # Fastest - tc : O(n) / sc : O(1
6
+ s = ''.join(re.findall(r'[a-z0-9]+', s.lower()))
7
+ return s == ''.join(reversed(s))
0 commit comments