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 ndj_ys
def non_repeat(line):
string,string_list,index = "",[],0
while len(line) > index:
if line[index] not in string:
string += line[index]
index += 1
else:
line = line[1:]
string_list.append(string)
string,index = "",0
else:
string_list.append(string)
lenline = [len(i) for i in string_list]
return string_list[lenline.index(max(lenline))]
Aug. 29, 2018