Before the gates of the railway depot of Cinderline close for winter, Urmila must finish the panels ledger - one figure at a time. Task: Print the length of the longest substring of s containing at most k distinct characters. Input format: One line: k then string s (space-separated). Output format: Print the maximum length. Constraints: 1 <= k <= 26; 1 <= |s| <= 4000; lowercase letters.
Example 1:
Example 2:
Example 3:
Constraints:
1 <= k <= 26; 1 <= |s| <= 4000; lowercase letters.
