解题思路:
所有元素相继异或的最终结果
class Solution {
public int singleNumber(int[] n) {
int re=n[0];
for(int i=1;i<n.length;i++){
re=re^n[i];
}
return re;
}
}
解题思路:
所有元素相继异或的最终结果
class Solution {
public int singleNumber(int[] n) {
int re=n[0];
for(int i=1;i<n.length;i++){
re=re^n[i];
}
return re;
}
}