• + 2 comments

    If you want to utilize the Counter you can do (Counter(s1) - Counter(s2)).elements() this returns an iterator. So either convert to list then sum or use sum(1 for _ in iterator).