/* * 136. Single Number * 2016-5-22 by Mingyang */ public int singleNumber(int[] nums) { int len=nums.length; if(nums==null||len==0) return 0; int res=0; for(int i=0;i<len;i++){ res=res^nums[i]; } return res; }
/* * 136. Single Number * 2016-5-22 by Mingyang */ public int singleNumber(int[] nums) { int len=nums.length; if(nums==null||len==0) return 0; int res=0; for(int i=0;i<len;i++){ res=res^nums[i]; } return res; }