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.
Show Company Tags
Show Tags
Show Similar Problems
原题地址
利用hash table统计substring里的字符,类似的以char为key的题都可以用数组来做,会快一些。
|
|
近期评论