Strings: Making Anagrams

  • + 26 comments

    It appears to me my python solution is much better then the one posted in editorial:

    from collections import Counter
    def number_needed(a, b):
        ct_a = Counter(a)
        ct_b = Counter(b)
        ct_a.subtract(ct_b)
        return sum(abs(i) for i in ct_a.values())
    

    Cons?