Given a string, find the length of the longest substring T that contains at most k distinct characters.
For example, Given s = “eceba” and k = 2,
T is “ece” which its length is 3.
|
|
Dec 8 update:
mistakes made: thought there are only letters but all ASCII characters are possible input.