Course · Section 9: Data Structures, Modern Operators and Strings · Lecture 122: Sets
Design a set of integers. Implement `MyHashSet`: - `add(key)` inserts the key. - `remove(key)` deletes the key if present. - `contains(key)` returns whether the key is present.
+ 1 hidden test run on Submit.
Backing the set with a Set gives O(1) average membership operations.
Run your code to see results.