You are viewing a single comment's thread. Return to all comments →
I am assuming you use 1 instead of 0 as in the following case:
d.setdefault(word, 1) #use 1 instead of 0 d[word] += 1
In this case, it mis-counts the number of occurences by 1.
Seems like cookies are disabled on this browser, please enable them to open this website
Hash Tables: Ransom Note
You are viewing a single comment's thread. Return to all comments →
I am assuming you use 1 instead of 0 as in the following case:
In this case, it mis-counts the number of occurences by 1.