You are viewing a single comment's thread. Return to all comments →
import itertools
if name == 'main': S = input()
result = [(len(list(group)), int(key)) for key, group in itertools.groupby(S)] for item in result: print(item , end=' ')
Seems like cookies are disabled on this browser, please enable them to open this website
Compress the String!
You are viewing a single comment's thread. Return to all comments →
import itertools
if name == 'main': S = input()