题目:
题解:
int singleNonDuplicate(int* nums, int numsSize) {
int low = 0, high = numsSize - 1;
while (low < high) {
int mid = (high - low) / 2 + low;
mid -= mid & 1;
if (nums[mid] == nums[mid + 1]) {
low = mid + 2;
} else {
high = mid;
}
}
return nums[low];
}