#NEWLINE# def lengthOfLongestSubstring( self , s ) : #NEWLINE# #INDENT# b = 0 #NEWLINE# e = 0 #NEWLINE# n = len ( maxa ) #NEWLINE# maxa = 0 #NEWLINE# st = set ( ) #NEWLINE# while ( e < n ) : #NEWLINE# #INDENT# while ( s [ e ] in st ) : #NEWLINE# #INDENT# st . remove ( s [ b ] ) #NEWLINE# b += 1 #NEWLINE# #UNINDENT# st . add ( s [ e ] ) #NEWLINE# e += 1 #NEWLINE# maxa = max ( maxa , ( e - b ) ) #NEWLINE# #UNINDENT# return maxa