Grokking the Coding Interview: Patterns for Coding Questions
Ask Author
Back to course home

0% completed

Vote For New Content
Hey, thanks for this course in general and for the good explanations.My question...

Viktor

Oct 27, 2022

Hey, thanks for this course in general and for the good explanations. My question is: could we have just

if char_frequency[right_char] = 0

instead of

if char_frequency[right_char] >= 0

in Python example? To count only when we match all occurrences of a character.

0

0

Comments
Comments
Design Gurus
Design Gurus3 years ago

We have to count every matching. We can't skip an occurrence and count only when a character is fully matched.

On this page