Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
adds ValidPalindrome python3 solution
  • Loading branch information
James Ulaszek authored and James Ulaszek committed Feb 1, 2022
commit c280b3794637c9df602d2fbfb4a7daa1e4fcd9fd
12 changes: 12 additions & 0 deletions algorithms/python/ValidPalindrome/isPalindrome.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class Solution:
def isPalindrome(self, s: str) -> bool:
temp = ""

for i in s:
if i.isalpha() or i.isdigit():
temp = (temp+i).lower()

if temp[::-1] != temp:
return False
else:
return True