Back to Brain Tonic
AlgorithmsmediumBT-150
#150 Majority Element Magic
You're reading a stream of n integers, one at a time, and must decide whether some element appears more than n/2 times. You cannot store the entire stream and can only use O(1) extra memory. Is this possible?