Skip to content

Instantly share code, notes, and snippets.

@mohneesh7
Created October 6, 2024 17:32
Show Gist options
  • Select an option

  • Save mohneesh7/da76d851ef0edc477bf06a24307651e8 to your computer and use it in GitHub Desktop.

Select an option

Save mohneesh7/da76d851ef0edc477bf06a24307651e8 to your computer and use it in GitHub Desktop.
Solution for Valid Palindrome
# Solution for Valid Palindrome
class Solution:
def isPalindrome(self, s: str) -> bool:
s = s.lower()
s_list = list(s)
s = ''.join([x for x in s_list if x.isalnum()])
return s == s[::-1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment