python 面试总结
def get_str(s, n):i = n
_start = 0
_list =[]
while True:
if i <= len(s) and _start <= len(s):
_str = len(set(s))
if _str == n:
_list.append(s)
i += 1
elif _str < n:
i += 1
else:
_start += 1
i = _start + n
else:
break
_list = sorted(_list, key=lambda x:len(x))
return _list[-1]
页:
[1]