• repeat long

Hey guys,

first of all my code:

def func(text):
    counter = 0
    text_l = text.lower()

    for i in range(len(text_l) - 1):
        print(text_l[i], text_l[i+1])
        if text_l[i] == text_l[i+1]:
            counter += 1

    return counter

Now this returns the number of equal following chars in the whole string, but the task wants to return the longest substring. How can I divide text in suitable substrings?

Thanks for your help ...