//异或满足交换律和结合律 int singleNumber(int* nums, int numsSize){ int result = 0; for (int i=0; i<numsSize; i++) result ^= nums[i]; return result; }