Insert Delete GetRandom O(1)
Medium📝 Description
Design data structure supporting O(1) operations
Input Format
Series of operations
Output Format
Results of operations
Constraints
At most 2 * 10^5 operations
🔍 Sample Input
insert(1), remove(2), insert(2), getRandom()
✅ Sample Output
true, false, true, 1 or 2
Code Editor
Please login to run and submit code.
Results
Suggested Solution
Shortcuts: Ctrl+Enter to submit, Ctrl+Shift+R to run