Design a Snapshot Set Iterator

Design a Snapshot Set Iterator

Design an integer SnapshotSet supporting:

add(n) -> bool
remove(n) -> bool
contains(n) -> bool
getIterator() -> SnapshotIterator

A `SnapshotIterato...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: