Excuse me does anyone here know how can we remove duplicates from a string using unique func or any other func?
for example if i want to turn "fdfdfddf"
into "df"
I wrote the code below but it seems it doesn't work
#include <bits/stdc++.h>
using namespace std;
int main()
{
vector<int>t;
int n;
cin>>n;
string dd;
vector<string>s;
for(int i=0;i<n;i++)
{
cin>>dd;
s.push_back(dd);
sort(s[i].begin(),s[i].end());
unique(s[i].begin(),s[i].end());
cout<<s[i]<<"\n";
}
}