Compress the String!

  • + 0 comments
    s = input()
    
    for  key, grp in groupby(s):
        print(f"({len(list(grp))}, {key})", end=" ")