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 ; } } cout << " Max ▁ substring ▁ is ▁ : ▁ " << s . substr ( max_window_start , max_window_size ) << " ▁ with ▁ length ▁ " << max_window_size << endl ; }