Solve the finding longest substring containing only two unique characters in it in O(n).