Back to problems

Snapshot Set

Algorithm · OpenAI · Hard

Snapshot Set Hard · Data Structures · Company Tags · Hints Design a data structure that maintains a set of integers while supporting the ability to create read‑only snapshots of its state. Initially the set is empty. You must process a sequence of operations one by one, where each operation is one of the following: ADD x – inserts the integer x into the current set. If x already exists, the operation has no effect. REMOVE x – removes x from the current set. If x is not…

Checking your access…