We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
There is a possibility that an entry dicty[word] ends up negative meaning that the ransom note uses a particular word more times than the magazine has. I didn't use defaultdict but used the same logic with the last line different. I guess it doesn't test that edge case? Does this make sense or it the last check unnecessary?
Hash Tables: Ransom Note
You are viewing a single comment's thread. Return to all comments →
There is a possibility that an entry dicty[word] ends up negative meaning that the ransom note uses a particular word more times than the magazine has. I didn't use defaultdict but used the same logic with the last line different. I guess it doesn't test that edge case? Does this make sense or it the last check unnecessary?