count consecutive elements

Bischoop Bischoop at vimart.net
Fri Jan 15 22:32:37 EST 2021


On 2021-01-14, Tim Chase <python.list at tim.thechases.com> wrote:
>
> seems to only return one value so seems to get odd results if I
> specify something like
>
>   get_longest("aaabcccbbb")
>
> which at least here tells me that "c" is the longest run, even though
> aaa, bbb, and ccc are all runs of length 3.  The OP didn't specify
> what should happen in that case, so it would need some clarification.
>
>

In that case maybe good solution would be to return three of them?

--
Thanks



More information about the Python-list mailing list