我正在尝试练习一些编码问题,并且想知道如何为下面的代码string[i] in string[i+1:]
和string[i] not in seens
计算大O
def findNoCurring(string):
seens = set()
for i in range(len(string)):
if not string[i] in string[i+1:] and string[i] not in seens:
return string[i]
else:
seens.add(string[i])
return None