Files
alexm 568474d52f
Test (in pplus-core) / in-core (push) Failing after 28m44s
Initial commit
2026-11-12 22:23:48 -05:00

23 lines
617 B
Mojo

# probe: a Set: add, membership, size, and iteration order
# status: the expected output is Programming+'s interpreter's prediction; corpus.py verify confirms or refutes it on godbolt
# expect-stdout: unique: 4
# expect-stdout: 4
# expect-stdout: 1
# expect-stdout: 9
# expect-stdout: 7
# expect-stdout: dups: [4, 1, 9]
from std.collections import Set
def main():
var seen = Set[Int]()
var dups = List[Int]()
for x in [4, 1, 4, 9, 1, 7, 9]:
if x in seen:
dups.append(x)
seen.add(x)
print("unique:", len(seen))
for x in seen:
print(x)
print("dups:", dups)