If you make it generic, use a `StringSet` or an intermediate sort to avoid the n^2 complexity please, and I can also use it for the functions I cited.