Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Long Non Repeat by DEADPOOL
def non_repeat(line):
result = ''
for i in range(len(line)):
value = ''
for j in range(i,len(line)):
char = line[j]
if char not in value:
value += char
if len(value) > len(result):
result = value
else:
break
return result
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"?')
Dec. 16, 2018