input: Write a function to count pairs of numbers that sum to a target value.
  assert count_pairs([1, 2, 3, 4, 3], 6) == 2
  assert count_pairs([1, 5, 7, -1, 5], 6) == 3
  assert count_pairs([1, 1, 1, 1], 2) == 6
output: def count_pairs(nums, target):
      count = 0
      freq = {}
      for num in nums:
          if target - num in freq:
              count += freq[target - num]
          if num in freq:
              freq[num] += 1
          else:
              freq[num] = 1
      return count