Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
RegExp Puzzle solution in Creative category for Long Repeat by nakanohito_piyo
import re
def long_repeat(line):
pattern = r"(.)\1*"
return max([0]+[len(m.group(0)) for m in re.finditer(pattern, line)])
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"?')
July 20, 2018