12. 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
Example 1:
Example 2:
Solution: (Sliding Window)
Time Complexity: O(n)
Previous11.Longest Substring Without Repeating CharactersNext13. Longest Substring with At Least K Repeating Characters
Last updated