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