Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
1-liner: proceed by each chunk of data solution in Clear category for Long Non Repeat by Stensen
def non_repeat(line):
if not line: return ''
answers, chunk = [], ''
for i in range(len(line)):
for j in line[i:]:
if j not in chunk: chunk += j
else: answers.append(chunk);chunk = j
answers.append(chunk); chunk = '' # Append Last Chunk & Empty Chunk
return max(answers, key=len)
Oct. 26, 2020