input: Write a function to count the number of pairs with a given sum x from a list of numbers. If the given list is empty then return 0.
  assert count_pairs([1, 2, 3, 4, 5, 6], 10) == 1
  assert count_pairs([1, 9, 4, 6, 5, 3], 10) == 3
  assert count_pairs([1, 2, 3, 4, 5], 10) == 2
  assert count_pairs([], 10) == 0
output: def count_pairs(nums, x):
      count = 0
      seen = set()
      for num in nums:
          complement = x - num
          if complement in seen:
              count += 1
          seen.add(num)
      return count