python练习题【杭州多测师】【杭州多测师_王sir】

 

 

def foo(value):
    dict1 = {}
    a = 0
    num =0
    for i in range(len(value)):
        if value[i] in dict1:
            num = max(dict1[value[i]],num)
        a = max(i-num+1, a)
        dict1[value[i]] = i+1
    print(a)

foo('hello')
foo('aaaaa')

运行结果:
3
1

 

SQL语句如下:
delete from number where ID not in (select min(ID) from number group by Name)

 

 

 答案:

这个题目自己做吧!!!

 

posted @ 2021-03-16 15:26  多测师_树哥  阅读(158)  评论(0编辑  收藏  举报