Refactor 'longest substring without repeating characters' again.