X

DAYS

:

HOUR

:

MINS

:

SEC

Amazon phone: Highest occurring item in a stream

Say on amazon website, a user gets to cast one vote for their favorite item. Given this data (which is sooo huge) find the top most voted item. Criteria Time: O(n) Space: O(1).
Things I tried:
1)Hashmap 2)Divide the steam and pick top from each 3)Using Moore’s Voting Algorithm
 

Author: Sruthi Nagalla
Login to Answer
Sort By:
Oldest
|
Newest
|
Vote
|
My Answer