10033. Length of Longest Subarray With at Most K Frequency
You are given an integer array
numsand an integerk.The frequency of an element
xis the number of times it occurs in an array.An array is called good if the frequency of each element in this array is less than or equal to
k.Return the length of the longest good subarray of
nums.A subarray is a contiguous non-empty sequence of elements within an array.
1 | class Solution { |