In line 30 of the solution,
if char_frequency[left_char] == 0:
matched -= 1
why do we only deduce the matched number when ==, but not >=
in line 17,
if char_frequency[right_char] >= 0:
it is >=
I changed the == to >=, the results are the same
Course: Grokking the Coding Interview: Patterns for Coding Questions - Learn Interactively
Lesson: Solution Review: Problem Challenge 3 - Grokking the Coding Interview: Patterns for Coding Questions