Update the max window size if required
if ( curr_end - curr_start + 1 > max_window_size ) { max_window_size = curr_end - curr_start + 1 ; max_window_start = curr_start ; } } document . write ( " " + s . substring ( max_window_start , max_window_start + max_window_size + 1 ) + " " + max_window_size ) ; }