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

0% completed

Vote For New Content
if (charFrequencyMap.get(rightChar) >= 0) // count every matching of a character...

aj

Jun 16, 2022

if (charFrequencyMap.get(rightChar) >= 0) // count every matching of a character

the comment for this line mentions that every match of a character is counted i.e. matched is incremented but that isn't true is it. We won't count EVERY matching of a character. For 'aabdec' and 'abc'.. we will increment matched just for the 1st 'a' and NOT the second.

So the comment is a bit misleading imo.

0

0

Comments
Comments

On this page