159. Longest Substring with At Most Two Distinct Characters

Problem

Find the length of the longest substring that contains at most 2 distinct characters.

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

Examples
Input: "eceba"
Output: 3
Hints
Related Problems

159. Longest Substring with At Most Two Distinct Characters

Find the length of the longest substring that contains at most 2 distinct characters.