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.
I started my solution with Counter in mind, however started using the concepts of keys for the counter combined with sets to get a set difference, and steered into fairly complicated direction.
Looking at your code, I now realize that Counter was indeed a better solution for this problem in python.
Lesson learned: Always go and check what more features are provided in the standard library (like counter) before moving away from it.
Thanks.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Strings: Making Anagrams
You are viewing a single comment's thread. Return to all comments →
I started my solution with Counter in mind, however started using the concepts of keys for the counter combined with sets to get a set difference, and steered into fairly complicated direction.
Looking at your code, I now realize that Counter was indeed a better solution for this problem in python.
Lesson learned: Always go and check what more features are provided in the standard library (like counter) before moving away from it.
Thanks.