Examples
Input: ([("add", 5), ("add", 2), ("add", 8), ("remove", 5), ("iterator", "it"), ("add", 1), ("contains", 2), ("remove", 2), ("contains", 2), ("add", 2), ("iterator", "it2"), ("iterate", "it"), ("iterate", "it2")],)
Expected Output: [True, False, [2, 8], [1, 2, 8]]
Explanation: The first iterator snapshots the set after 5 was removed, so it sees {2, 8}. Later changes do not affect it. The second iterator is created after 1 and 2 are both present, so it sees {1, 2, 8}.
Input: ([("remove", 10), ("iterator", "a"), ("iterate", "a"), ("add", 4), ("add", 4), ("contains", 4), ("iterator", "b"), ("remove", 4), ("iterate", "b"), ("contains", 4)],)
Expected Output: [[], True, [4], False]
Explanation: Removing 10 does nothing. Snapshot a is taken on an empty set. Adding 4 twice still leaves one copy. Snapshot b keeps [4] even though 4 is removed later.
Input: ([("add", 1), ("add", 2), ("iterator", "x"), ("remove", 1), ("iterator", "y"), ("add", 1), ("iterator", "z"), ("iterate", "x"), ("iterate", "y"), ("iterate", "z")],)
Expected Output: [[1, 2], [2], [1, 2]]
Explanation: Each iterator captures a different moment in time: x sees {1,2}, y sees {2}, and z sees {1,2} after 1 is added back.
Input: ([("add", -3), ("contains", -3), ("iterator", "s"), ("remove", -3), ("contains", -3), ("iterate", "s"), ("iterator", "t"), ("iterate", "t")],)
Expected Output: [True, False, [-3], []]
Explanation: This checks negative numbers and empty snapshots. Iterator s keeps -3 even after it is removed. Iterator t is created after the set becomes empty.