LeetCode problem: 340. Longest Substring with At Most K Distinct Characters Given a string, find the length of the longest substring in it with no more than K distinct characters. Input: ...