What I've done in the past is I've sorted the vector, used vector.count() to find all how many times the first element appears. I then store that, and erase all of those that are the same. I then proceed to do the same procedure until I reach the end. I'm sure that the other ways would work as well, but I just thought I'd put in my two cents.