Practice Problem
Insert Delete GetRandom O(1)
Difficulty: Medium
Design a data structure that supports insert, remove, and getRandom in average O(1) time using a hash map paired with a dynamic array.
Practice Problem
Difficulty: Medium
Design a data structure that supports insert, remove, and getRandom in average O(1) time using a hash map paired with a dynamic array.