#include #include using namespace std; int main() { string s = "aaaabbbcccddd"; // unordered_set doesn't allow for duplicates unordered_set t(s.begin(), s.end()); string u(t.begin(), t.end()); sort(u.begin(), u.end()); cout << u << endl; return 0; }