Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
double for loop solution in Clear category for Long Non Repeat by mplichta
def non_repeat(s):
for l in range(len(s), 0, -1):
for i in range(0, len(s) - l + 1):
sub = s[i:i + l]
if all(sub.count(c) == 1 for c in sub):
return sub
return ''
June 6, 2018