Skip to content

Commit 8c3ed23

Browse files
author
jinbeom
committed
Fix Valid Palindrome Solution
1 parent eba954e commit 8c3ed23

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

valid-palindrome/kayden.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ def isPalindrome(self, s: str) -> bool:
66
string = ""
77

88
for letter in s:
9-
if letter.isalnum():
9+
if letter.isalnum(): # if ('a' <= char <= 'z') or ('A' <= char <= 'Z') or ('0' <= char <= '9'):
1010
string += letter.lower()
1111

1212

1313
def valid(s):
14-
st, en = 0, len(s)-1
14+
start, end = 0, len(s)-1
1515

16-
while st < en:
17-
if s[st] != s[en]:
16+
while start < end:
17+
if s[start] != s[end]:
1818
return False
1919

20-
st += 1
21-
en -= 1
20+
start += 1
21+
end -= 1
2222

2323
return True
2424

0 commit comments

Comments
 (0)