public class Solution {
public int singleNumber(int[] nums) {
int ret = nums[0];
for (int i = 1; i < nums.length; i++) {
ret ^= nums[i];
}
return ret;
}
}
public class Solution {
public int singleNumber(int[] nums) {
int ret = nums[0];
for (int i = 1; i < nums.length; i++) {
ret ^= nums[i];
}
return ret;
}
}
转载于:https://www.cnblogs.com/puck/p/4561270.html