题目路径:

​https://leetcode-cn.com/problems/single-number/​

leetcode_136_只出现一次的数字_i++

 

解题思路: 

public int singleNumber(int[] nums) {
int temp=nums[0];
for (int i = 1; i < nums.length; i++) {
temp = temp ^ nums[i];
}
return temp;
}

 

效果:

leetcode_136_只出现一次的数字_i++_02