Compress the String!

  • + 0 comments

    s = input().strip() for key, group in groupby(s): key = int(key) result = [(len(list(group)), key)] print(' '.join(map(str, result)), end = " ")