Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Long Repeat solution in Clear category for Long Repeat by W.Zalicki
def long_repeat(line):
count = 1
maxi = 1
if line != "":
for i in range(1,len(line)):
if line[i] == line[i-1]:
count+=1
if count > maxi:
maxi = count
else:
count = 1
return maxi
else:
return 0
Nov. 5, 2017
Comments: