Find Unique Element (All Others Appear Twice)
mid with
mid^1 (XOR to get pair)
Problem: Every element appears twice except one. Array is sorted. Find the unique.
Key: Use parity! Before unique: first of pair at even index. After unique: first at odd index.
Logic: If mid is even, check
arr[mid] == arr[mid+1]. If true, unique is on right.
Time: O(log n)