Insert Delete GetRandom O(1) with Duplicate Strings

Problem

Implement a string collection, RandomizedCollection, that allows duplicates and supports each operation in average O(1) time:

  • insert(value): Insert one occurrence of a string. R...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: