Skip to content

Commit 9db4e7e

Browse files
Added solution
1 parent c5aafc6 commit 9db4e7e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

valid_palindrome.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
class Solution:
2+
def isPalindrome(self, s: str) -> bool:
3+
s = s.lower()
4+
stt = []
5+
for st in s:
6+
if st >= 'a' and st <= 'z' or st >= '0' and st <= '9':
7+
stt.append(st)
8+
print(stt)
9+
i = 0; j = len(stt) - 1
10+
11+
while(i <= j):
12+
if stt[i] != stt[j]:
13+
return False
14+
i += 1
15+
j -= 1
16+
return True

0 commit comments

Comments
 (0)