Design a SnapshotSet data structure supporting the following operations: - add(x): Add element x to the set. Returns whether it was newly added. - remove(x): Remove element x from the set. Returns whether it was present. - contains(x): Return whether x is currently in the set (reflects real-time state). -…