input: from typing import List
  
  def find_duplicate_numbers_xor(nums: List[int]) -> int:
      """
      Given an array nums where each number appears either once or twice,
      compute and return the bitwise XOR of all numbers that appear twice.
      Return 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
      Each number in nums appears either once or twice.
      """
output:     seen = set()
      xor_result = 0
      for num in nums:
          if num in seen:
              xor_result ^= num
          else:
              seen.add(num)
      return xor_result