Practice
/

Insert Delete GetRandom O(1)

Insert Delete GetRandom O(1)

Design a data structure that supports insert, remove, and getRandom in average O(1) time using a hash map paired with a dynamic array.

Premium Content

Create a free account, then unlock this problem and the entire premium catalog with a one-time CodeSnatch Premium purchase.

Already have an account with premium access? Sign in to continue.