Skip to content

Commit adf6965

Browse files
author
Joseph Luce
authored
Update 409_longest_palindrome.md
1 parent a577a4a commit adf6965

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

leetcode/easy/409_longest_palindrome.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,19 @@ class Solution:
2929
def longestPalindrome(self, s: str) -> int:
3030
ch_to_count = Counter(s)
3131
longest_length = 0
32-
only_one = greater_than_one = False
32+
only_one = odd_greater_than_one = False
3333
for count in ch_to_count.values():
3434
if count % 2 == 0: # even
3535
longest_length += count
3636
else: # odd
3737
if count == 1:
3838
only_one = True
3939
else:
40-
greater_than_one = True
40+
odd_greater_than_one = True
4141
longest_length += count-1
4242
if only_one:
4343
longest_length += 1
44-
elif greater_than_one:
44+
elif odd_greater_than_one:
4545
longest_length += 1
4646
return longest_length
4747
```

0 commit comments

Comments
 (0)