Find XOR of Numbers Twice

You are given an array nums where each integer appears at most twice. Return the XOR of all numbers that appear exactly twice.

Examples
Input: [1,2,1,3]
Output: 1
Hints

Find XOR of Numbers Twice

You are given an array nums where each integer appears at most twice. Return the XOR of all numbers that appear exactly twice.