Skip to content

Commit 46211b9

Browse files
committed
feat: 125. Valid Palindrome
1 parent ad4791d commit 46211b9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

valid-palindrome/HodaeSsi.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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]
8+

0 commit comments

Comments
 (0)