Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Brain's brake solution in Creative category for Long Non Repeat by Dr__ON
def non_repeat(line):
if len(line) < 3:
return line
res = []
for x in range(len(line)+1):
for y in range(len(line)+1):
if len(set(line[x:y])) == len(line[x:y]):
res.append(line[x:y])
return max(res, key=len)
if __name__ == '__main__':
#These "asserts" using only for self-checking and not necessary for auto-testing
assert non_repeat('aaaaa') == 'a', "First"
assert non_repeat('abdjwawk') == 'abdjw', "Second"
assert non_repeat('abcabcffab') == 'abcf', "Third"
print('"Run" is good. How is "Check"?')
Oct. 9, 2018