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.
Nice way to use Counter, I didn't know you can use it like that. But I tested it with 1000000 queries against defaultdict and defaultdict is around 15-20% faster. I guess both of them using a lot of memory but as a dictionaries and hashmaps problem it's not so important here.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Frequency Queries
You are viewing a single comment's thread. Return to all comments →
Nice way to use Counter, I didn't know you can use it like that. But I tested it with 1000000 queries against defaultdict and defaultdict is around 15-20% faster. I guess both of them using a lot of memory but as a dictionaries and hashmaps problem it's not so important here.