Skip to content

Commit 188db98

Browse files
committed
2 parents fb3980d + 499d34a commit 188db98

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

valid-palindrome/heypaprika.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ def isPalindrome(self, s: str) -> bool:
77
if (ord("a") <= ord(item) <= ord("z")) or (ord("0") <= ord(item) <= ord("9")):
88
new_s += item
99
output = True
10-
for i in range(len(new_s) // 2):
11-
if new_s[i] != new_s[-i-1]:
12-
output = False
13-
break
10+
new_s_2 = new_s[::-1]
11+
return new_s_2 == new_s
1412
return output
1513

0 commit comments

Comments
 (0)