Skip to content

Commit e9a35e3

Browse files
committed
feat: add 0220 Valid Palindrome solution
1 parent 5916ab4 commit e9a35e3

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

valid-palindrome/hyogshin.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
class Solution:
2+
def isPalindrome(self, s: str) -> bool:
3+
alnum = []
4+
is_pal = True
5+
for c in s:
6+
if c.isalnum():
7+
alnum.append(c.lower())
8+
9+
for c in range(len(alnum) // 2):
10+
if alnum[c] != alnum[-1 - c]:
11+
is_pal = False
12+
break
13+
14+
return is_pal

0 commit comments

Comments
 (0)