class Solution(object):
def lengthOfLongestSubstring(self, s):
"""
:type s: str
:rtype: int
"""
temp = ''
length = 0
for i in s:
if i not in temp:
temp+=i
length = max(length,len(temp))
else:
temp+=i
kk=temp.index(i)
print('kk=',kk)
temp = temp[kk+1:]
print(temp)
return length
a='baaaabcdea'
c=Solution()
c1=c.lengthOfLongestSubstring(a)
print(c1)