Search
⌘K

Leetcode 540. Single Element in a Sorted Array

Given a sorted array where every element appears exactly twice except for one that appears once, find that single element in O(log n) time and O(1) space by using binary search that exploits pair alignment (index parity) to locate the half containing the singleton.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.