Single Element in a Sorted Array

Given a sorted array where every element appears twice except for one element which appears once, find the single element that appears only once.

Examples

Example 1:

Input:

nums = [1,1,2,3,3]

Output:

2
Loading...
Single Element in a Sorted Array - Binary Search