Problem 381 · Hard

Insert Delete GetRandom O(1) - Duplicates allowed

Maintain duplicate values with constant-time insert remove and occurrence-weighted random selection.

Open the interactive visualisation