159. Longest Substring with At Most Two Distinct Characters

Given a string s, find the length of the longest substring that contains at most 2 distinct characters.

Examples
Input: "a"
Output: 1
Hints
Related Problems

159. Longest Substring with At Most Two Distinct Characters

Given a string `s`, find the length of the longest substring that contains at most 2 distinct characters.