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 SzOp
def isUnique(word):
uniq = ""
for letter in word:
if letter not in uniq:
uniq+=letter
else:
return False
return True
def non_repeat(line):
longest = line[0:1]
for i in range(len(line)+1):
for j in range(len(line)+1):
if j>i:
if isUnique(line[i:j]) and len(line[i:j])>len(longest):
longest = line[i:j]
return longest
Nov. 1, 2018
Comments: