input: from typing import List
  
  def find_duplicate_numbers_xor(nums: List[int]) -> int:
      """
      Given an array nums, where every number appears either once or twice.
      Return the XOR of all numbers that appear twice in the array, or 0 if no number appears twice.
  
      Examples:
      >>> nums = [1,2,1,3]
      1
      >>> nums = [1,2,3]
      0
  
      Constraints:
      1 <= len(nums) <= 50
      1 <= nums[i] <= 50
      Every number in nums appears either once or twice.
      """
output:     from collections import Counter
  
      counter = Counter(nums)
      result = 0
      for num, count in counter.items():
          if count == 2:
              result ^= num
      return result