0159. Longest Substring with At Most Two Distinct Characters
Previous0158. Read N Characters Given Read4 II - Call multiple timesNext0160. Intersection of Two Linked Lists
Last updated
Was this helpful?
Last updated
Was this helpful?
https://leetcode.com/problems/longest-substring-with-at-most-two-distinct-characters
Given a string s
, return the length of the longest substring that contains at most two distinct characters.
Example 1:
Example 2:
Constraints:
1 <= s.length <= 105
s
consists of English letters.
same as this one: