package lianxi; import java.util.*; public class UnionSearch { public static void main(String[] args) { int[] array1 = {49,36,13,27,48,100,67,73,85,28,99,56}; int[] array2 = {34,45,13,67,23,56,28,90}; long mtime,etime,time; Date myDate = new Date();
Given an array of integers, every element appears twice except for one. Find that single one. Note:Your algorithm should have a linear runtime complexity. Could you implement it without using extra memory? 数组中除了某个元素出现一次,其他都出现两次,找出只出现一次的元素. 一个数字和自己异或