Longest Substring With At Most Two Distinct Characters

medium
Given a string s, return the length of the longest substring that contains at most two distinct characters.

Input Format

Input is managed for u

Output Format

Output is managed for u.

Constraints

1. 1 <= s.length <= 105
2. s consists of English letters.

Notice

.

Example

Input
eceba
Output
3
Previous
Random Pick With Blacklist
Next
A Simple Fraction

Related Questions