As far as I know, there are three ways to deduplicate the elements of a list,
and all of them can be implemented by modifying the argument or returning a new
seq. You introduced the method that uses the set, but your implementation
destroys the order of elements in a seq, I think that is not necessary. The
third alternative is, to sort the collection, and then deduplicate _O(n log
n)_. This is clearly faster than _O(n²)_, but destroys definitively the order.
The advantage compared to the hashing implementation is, that it can be
implemented without any allocation.