Is there a way to remove duplicate characters from a string like they can be removed from vectors as below
sort( vec.begin(), vec.end() );
vec.erase( unique( vec.begin(), vec.end() ), vec.end() );
or do I just have to code up a basic solution for it? What I have thought:
I could add all the characters into a set
"ABACADAF"have duplicateAs? Or would you just want"AABACAD"to remove the firstAin the doubleAA?O(n log(n))solution while you can do it inO(n)as explained here in the Second method?