Skip to content

Commit a302fff

Browse files
committed
220
1 parent 119514c commit a302fff

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

valid-palindrome/jeldo.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class Solution:
2+
# O(n)
3+
def isPalindrome(self, s: str) -> bool:
4+
s = ''.join(ch.lower() for ch in s if ch.isalnum()) # O(n)
5+
return s == s[::-1] # O(n)

0 commit comments

Comments
 (0)