8000 adds ValidPalindrome python3 solution · ulaszek-james/leetcode@c280b37 · GitHub
[go: up one dir, main page]

Skip to content

Commit c280b37

Browse files
James UlaszekJames Ulaszek
James Ulaszek
authored and
James Ulaszek
committed
adds ValidPalindrome python3 solution
1 parent 5051980 commit c280b37

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class Solution:
2+
def isPalindrome(self, s: str) -> bool:
3+
temp = ""
4+
5+
for i in s:
6+
if i.isalpha() or i.isdigit():
7+
temp = (temp+i).lower()
8+
9+
if temp[::-1] != temp:
10+
return False
11+
else:
12+
return True

0 commit comments

Comments
 (0)
0