Special String Again

  • + 0 comments

    Nice solution! One thing that condenses the code a bit is using itertools.groupby to turn the logic of the first loop into a 1 liner:

    l = [(ch, len(list(g))) for ch, g in groupby(s)]