#counting
Count items or occurrences.
- count_by(items, key)Count how many items map to each key, using collections.Counter.
- duplicates(items) +1List the values that repeat, or the ones that appear exactly once.
- have_same_contents(a, b)Compare two collections regardless of order, counting duplicates, in linear time.
- most_frequent(items)Return the most common item, breaking ties by first appearance.
- hamming_distance(a, b)Count the positions at which two equal-length strings differ.