Advertisement
furas

Python - example

Mar 2nd, 2017
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.17 KB | None | 0 0
  1. def remove_duplicates(text):
  2.     unique = ''.join(sorted(set(text)))
  3.     return (unique, len(text) - len(unique))
  4.  
  5. print( remove_duplicates("bbbcddcc") )
  6. # ('bcd', 5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement