Longest Substring with At Most K Distinct

Sliding Window ยท medium

Implement `longestKDistinct(s, k)` returning the length of the longest substring containing at most `k` distinct characters.

Learning resources

Loading...

Run your code to see results.