Phenom Interview Question

split the string such that each character comes only once in a splitted string