Skip to content

Instantly share code, notes, and snippets.

@tamunoibi
Created April 9, 2018 21:05
Show Gist options
  • Save tamunoibi/fb52784f0d9bf7d178ae2edc4ef32e2d to your computer and use it in GitHub Desktop.
Save tamunoibi/fb52784f0d9bf7d178ae2edc4ef32e2d to your computer and use it in GitHub Desktop.
def remove_duplicates(word):
new_word = "".join(sorted(dict.fromkeys(word)))
return (new_word, len(word)-len(new_word))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment