Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Long Repeat by szneqz
def long_repeat(line):
maxy = 0
act = 0
if len(line) > 0:
last = line[0]
for letter in line:
if letter == last:
act = act + 1
else:
act = 1
last = letter
if act > maxy:
maxy = act
return maxy
if __name__ == '__main__':
print(long_repeat('sdsffffse'))
#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"?')
Jan. 22, 2018
Comments: