Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
314 B
2
Indexable
Never
word = input()
newWord = ''
dict = {}
for ch in word:
    if ch not in dict:
        dict[ch] = 1
    else:
        dict[ch] += 1

min = 100000
for key in dict:
    if min>dict[key]:
        min=dict[key]
    dict[key]=0

for ch in word:
    if dict[ch]<min:
        newWord+=ch
        dict[ch]+=1

print(newWord)