Showing 3 of 3 questions
Design a data structure that supports insert, delete, and getRandom operations, all in constant time, even when duplicate numbers are allowed. The getRandom method should return a random element from the collection with equal probability.
#1. Insert Delete GetRandom O(1) - Duplicates allowed
Design a data structure that supports insertion, deletion, and random element retrieval, all in constant time on average. You'll need to handle edge cases carefully to achieve O(1) complexity.
#2. Insert Delete GetRandom O(1)
You're given a list of domain names with visit counts. Calculate and return the visit counts for each subdomain.
#3. Subdomain Visit Count
Page 1 of 1 · 3 total