340. Longest Substring with At Most K Distinct Characters

Problem

Find the length of the longest substring that contains at most k distinct characters.

Given a string s and an integer k, find the length of the longest substring that contains at most k distinct characters.

Examples
Input: ["eceba",2]
Output: 3
Hints
Related Problems

340. Longest Substring with At Most K Distinct Characters

Find the length of the longest substring that contains at most k distinct characters.