Skip to content

Commit cac4c99

Browse files
committed
feat: 125. Valid Palindrome
1 parent a3e7172 commit cac4c99

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

valid-palindrome/hodaessi.py

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

0 commit comments

Comments
 (0)