Completed longest substring without repeating chars problem