fork download
  1. from collections import OrderedDict as O
  2.  
  3. #s=input()
  4.  
  5. f=lambda s:"".join([c*(s.count(c)&-2)for c in O.fromkeys(s)])
  6. print(f("CAB"))
Success #stdin #stdout 0.01s 10248KB
stdin
Standard input is empty
stdout