You are viewing a single comment's thread. Return to all comments →
import itertools print(" ".join(f"({len(list(g))}, {k})" for k, g in itertools.groupby(input())))
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 →