-------------------------------- 这道题好坑啊,自己说是2*n+1个数字,结果有组测试数据竟然传了个空数组进来... 经典位算法: n^n==0 n^0==n AC代码: public class Solution { /** *@param A : an integer array *return : a integer */ public int singleNumber(int[] A) { if(A.length==0) return 0; int n=A…
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? 题目标签:Hash Table 题目给了我们一个 nums array, array 里…