input: from typing import List
  
  def find_duplicate_xor(nums: List[int]) -> int:
      """
      Given an array nums where every number appears either once or twice,
      return the bitwise XOR of all numbers that appear twice, or 0 if no number appears twice.
  
      Examples:
      >>> nums = [1,2,1,3]
      1
      >>> nums = [1,2,3]
      0
  
      Constraints:
      1 <= nums.length <= 50
      1 <= nums[i] <= 50
      Each number in nums appears either once or twice.
      """
output:     count = {}
      for num in nums:
          if num in count:
              count[num] += 1
          else:
              count[num] = 1
  
      result = 0
      for num, cnt in count.items():
          if cnt == 2:
              result ^= num
  
      return result