delete duplicates from string implemented by LL