今天爱分享给大家带来python实现无重复字符的最长子串【面试题详解】【附代码】,希望能够帮助到大家。
class Solution(object):
def lengthOfLongestSubstring(self, s):
res = 0;i = 0; val = ""
for j in range(len(s)):
if s[j] not in s[i:j]:
res = max(res,j+1-i)
else:
i += s[i:j].index(s[j]) + 1
return res
原文链接:http://blog.itblood.com/4582.html,转载请注明出处。

![都市隐修1.0破解版 [国产RPG/完结/动态]](/wp-content/uploads/replace/2025/07/18/19c1012d96c6f7b7c2aad1a79980aaee.webp)