You are viewing a single comment's thread. Return to all comments →
s = input().strip() for key, group in groupby(s): key = int(key) result = [(len(list(group)), key)] print(' '.join(map(str, result)), 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 →
s = input().strip() for key, group in groupby(s): key = int(key) result = [(len(list(group)), key)] print(' '.join(map(str, result)), end = " ")