Create longest substring that contains at most two  characters.