Skip to content

Commit b59cf2e

Browse files
Solve : Valid Palindrome
1 parent 0823a9f commit b59cf2e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
class Solution:
2+
def isPalindrome(self, s):
3+
cleaned = [c.lower() for c in s if c.isalnum()]
4+
return cleaned == cleaned[::-1]

0 commit comments

Comments
 (0)