Given a string s and an integer k, return the length of the longest substring of s that contains at most k distinct characters. Input: '"s", k'.
Input: '"s", k'.
Output: Integer — length of longest valid substring.
Input: "eceba", 2
Output: 3
Explanation: 'ece' has 2 distinct chars.Input: "aa", 1
Output: 2
Explanation: 'aa' has 1 distinct.Input: "abc", 1
Output: 1
Explanation: At most 1 distinct char.0<=s.length<=5*10^40<=k<=50