update solution for delete duplicated characters