Available question text
Find the maximum-length contiguous subarray of nums such that every distinct element appears at most k times. This is a sliding-window / frequency-counting problem on an array of length up to 1e5, solvable in O(n) time using a running count of element frequencies.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 2958. Length of Longest Subarray With at Most K Frequency
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source