Given a string s and an integer k, return the length of the longest substring in which every distinct character appears at least k times. Input: '"s", k'.
Input: '"s", k'.
Output: Integer — length of the longest valid substring.
Input: "aaabb", 3
Output: 3
Explanation: 'aaa' has a appearing 3 times.Input: "ababbc", 2
Output: 5
Explanation: 'ababb': a x2, b x3.Input: "abc", 2
Output: 0
Explanation: No char repeats twice.1<=s.length<=10^41<=k<=10^5