dsa12 min read
Single Element in a Sorted Array — Parity Index Binary Search [LC 540, Google, Facebook]
Find the one non-duplicate element in O(log n) time by observing how pair indices shift after the singleton — a parity-based binary search that requires no XOR or extra space.
Read →