Ad
  • Default User Avatar

    It would have been better if you could have given the input.
    Did you try your solution with the below example (given in the description)?

    s = "uuaaaxbbbbyyhwawiwjjjwwxymzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
    hist(s) => "u..2.....**\rw..5.....*****\rx..2.....**\rz..31....*******************************"
    

    I tried your present solution on it and unfortunately it doesn't pass. Could you please give it a try?
    Cheers.