I'll also note there are two kinds of unique, and the shell-programming uniq and the C++ std::unique are a more limited but more efficient one: remove consecutive duplicate elements. That's useful for data already known to be sorted, but probably more expensive than the Set implementation when it isn't.
3 Likes