nums is sorted. Every value appears exactly twice, except for one value that appears once. Return that value.
Example 1
Input:
single_non_duplicate([1, 1, 2, 3, 3, 4, 4, 8, 8])
Output:
2
Example 2
Input:
single_non_duplicate([3, 3, 7, 7, 10, 11, 11])
Output:
10
1 <= len(nums) <= 2 * 10**5 + 1, and the length is oddnums is sorted in non-decreasing order.0 <= nums[i] <= 10**9in, .index, .count, min or sorted on the whole list, fails them.No results yet
Run your code to check it against the examples, or submit to run every test.