Tag Archives: xor

Single Number III

leetcode[Single Number III]. Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once. For example: Given nums = [1, 2, 1, 3, 2, 5], return [3, 5]. Solution. Since there are only 2 numbers which… Read More »