Skip to content

Commit eb0a554

Browse files
committed
update loop check
1 parent d67d051 commit eb0a554

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Python/chapter01/1.4 - PalinPerm/miguel_1.4_sol.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@ def is_permutation_of_palindrome(s: str) -> bool:
2828
num_odd_freq_chars = 0
2929

3030
for key, val in char_frequencies.items():
31+
if val % 2 == 0:
32+
continue
33+
num_odd_freq_chars += 1
3134
if num_odd_freq_chars > 1:
3235
return False
33-
if val % 2 != 0:
34-
num_odd_freq_chars += 1
3536
return True
3637

3738

0 commit comments

Comments
 (0)