Given a string, find the longest substring that contains only two unique characters. For example, given "abcbbbbcccbdddadacb", the longest substring that contains 2 unique character is "bcbbbbcccb".
Two pointers slider, maintain a valid solution containing only two chars, by:
-
inc counter if char is like the two
-
remove until string contains the current char and the previous char