Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Long Non Repeat by kdim
def non_repeat(line):
return max((line[i:j + 1] for i in range(len(line)) for j in range(i, len(line)) if
len(set(line[i:j + 1])) == len(line[i:j + 1])), key=len, default='')
if __name__ == '__main__':
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"?')
Jan. 24, 2023