Longest Substring with At Most K Distinct Characters

Given a string s, find the length of the longest substring T that contains at most k distinct characters.

For example, Given s = "eceba", k = 3, T is "eceb" which its length is 4.

Challenge O(n), n is the size of the string s.

results matching ""

    No results matching ""