Tap here to switch tabs
Problem
Submissions

Problem: Longest Substring with At Most Two Distinct Characters

med
30 min
Try to solve the Longest Substring with At Most Two Distinct Characters problem.

Statement

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

Constraints:

  • 1≤1 \leq s.length ≤105\leq 10^5

  • s consists of English letters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Longest Substring with At Most Two Distinct Characters

med
30 min
Try to solve the Longest Substring with At Most Two Distinct Characters problem.

Statement

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

Constraints:

  • 1≤1 \leq s.length ≤105\leq 10^5

  • s consists of English letters.