Available question text
Given an array and at most k deletions, find the maximum length of a contiguous subarray that can be made constant (all equal) after removing ≤k elements — equivalently, for some value v find the longest window where at most k elements differ from v. This reduces to testing candidate values and using a sliding-window/counting strategy to maximize the equal-run length.
Related questions
Continue with questions that share topics or the same question type.
- Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit
Coding · Array · Heap (Priority Queue) · Monotonic Queue
- Divide an array into subarray with equal sum.
Coding
- Find Longest Awesome Substring
Coding
- Find Longest Calls
Coding
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 2831. Find the Longest Equal Subarray
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source