Insert Delete GetRandom O(1) - Duplicates Allowed
Design a data structure that supports insert, remove, and getRandom (returns a random element with equal probability), all in average O(1), with duplicate keys allowed.
Enable JavaScript for the full StreamPrep guide.