def count_duplicate_matches(matches)
      matches.map { |match| matches_hash[Set.new match] }.reduce(0, :+)
    end
def count_duplicate_matches(matches)
      matches.map { |match| matches_hash[Set.new match] }.reduce(0, :+)
    end
Count the number of times each pair of teams has played already. Used by tournament systems.

 @param matches [Array<match>]
 @return [Integer] the number of duplicate matches