Given a sorted array of integers, determine if there exists a majority element (an element appearing strictly more than n/2 times) in O(log n) time, returning the element or -1 if absent.
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.