Skip to content

Latest commit

 

History

History

longest_substring_with_at_most_k_distinct_characters

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

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.

Solution

Sliding pointers