View Code of Problem 3924

#include<iostream>
using namespace std;
string str;
int a[30];
int main(){
    cin>>str;
    int n=str.length();
    for(int i=1;i<=n;i++){
        int x=str[i]-'a';
        a[x]++;
        if(a[x]==1){
            cout<<str[i];
        }
    }
    cout<<endl;
    return 0;
}

Double click to view unformatted code.


Back to problem 3924