@sha256pki The basic idea here is that there's only one element that appears once. Suppose a series of number that all the elements appear twice, then elements always change at even positions. If one element only appears once, then the rule will be broken and we can use binary search based on this rule.

Single Element in a Sorted Array