159 Longest Substring with At Most Two Distinct Characters
Problem:
Given a string, find the length of the longest substring T that contains at most 2 distinct characters.
For example, Given s = “eceba”,
T is "ece" which its length is 3.
Solutions:
Previous158 Read N Characters Given Read4 II – Call multiple times Add to List QuestionEditorial Solution –Next160 Intersection of Two Linked Lists – Easy
Last updated