This article shows how to implement the set built-in at the expense of a dictionary.
Maths is everywhere[citation needed].