Given a string s, return the length of the longest contiguous substring that contains at most two distinct characters.
Example 1
Input: "abacccbaaa"
Output: 5
Explanation: The longest substring with at most two distinct characters is "ccbaa".
Example 2
Input: "xyyyz"
Output: 4
Explanation: The longest substring with at most two distinct characters is "yyyz".
Constraints
Case 1
Input: "aabbccdde"
Expected: 4
Case 2
Input: "abcabcabc"
Expected: 2
Case 3
Input: "zzzzzz"
Expected: 6
Case 4
Input: "pqrstuv"
Expected: 1
Case 5
Input: "aabbaaabbb"
Expected: 7