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.
You can also do (Counter(s1) - Counter(s2)).values() to get the list of counts outright. Not a big difference but at least you can skip the step of converting to a list :)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Anagram
You are viewing a single comment's thread. Return to all comments →
You can also do (Counter(s1) - Counter(s2)).values() to get the list of counts outright. Not a big difference but at least you can skip the step of converting to a list :)