Prompt: Given a string s and an integer k, return the length of the longest substring of s such that the frequency of each character in this substring is greater than or equal to k.
Example:
Input: s = "aaabb", k = 3
Output: 3
Explanation: The longest substring is "aaa", as 'a' is repeated 3 times.
Input: s = "ababbc", k = 2
Output: 5
Explanation: The longest substring is "ababb", as 'a' is repeated 2 times and 'b' is repeated 3 times.
Solution: We can solve this with a sliding windows solution. The sliding window will have a condition that only a certain number of unique characters can be in it and all the unique characters must have the frequency of k or more. The runtime of this algorithm is O(m x n) where m is the number of unique characters in string s and n is the length of string s.