Spring Hire Sale
Limited Time Deal: Unlock all premium questions for over 30% off
$10.42$7.08
08
:
04
:
50
:
23
Back to Dashboard
Snapshot Set Iterator
Hard
Design a data structure called SnapshotSet that supports adding and removing integers, membership checks, and capturing immutable snapshots of the current state.
A snapshot records the elements present in the set at the moment getSnapshot is called, preserving their insertion order. Subsequent additions or removals must not affect previously captured snapshots.
...