Length of Longest Subarray With at Most K Frequency
Slide a window across the array, counting each value; when the value just added exceeds k, move the left edge until it is back to k.
Slide a window across the array, counting each value; when the value just added exceeds k, move the left edge until it is back to k.