Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Long Repeat by Julia_Wysocka
def long_repeat(line):
n=len(line)
howmany=0
many=1
i=0
while (ihowmany): #if the next letter is different, it's end of our substring
howmany=many #so we have to check if it's longer than the last substring
many=1
i=i+1
if (many>howmany and len(line)>0):
howmany=many
return howmany
if __name__ == '__main__':
#These "asserts" using only for self-checking and not necessary for auto-testing
assert long_repeat('sdsffffse') == 4, "First"
assert long_repeat('ddvvrwwwrggg') == 3, "Second"
print('"Run" is good. How is "Check"?')
Nov. 20, 2017