[leetcode] Longest Substring with At Most Two Distinct Characters
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. Two pointers. i points to the head of possible string and j points to the tail of it. […]