Skip to content

Instantly share code, notes, and snippets.

@ssadler
Last active December 24, 2015 18:49
Show Gist options
  • Save ssadler/6846192 to your computer and use it in GitHub Desktop.
Save ssadler/6846192 to your computer and use it in GitHub Desktop.
a = "ccbbaa"
a = sorted(a)
f = {}
n = 0
cc = a[0]
for c in a:
if c != cc:
f[cc] = n
n = 0
n += 1
cc = c
f[c] = n
print f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment