2831. Find the Longest Equal Subarray
You are given a 0-indexed integer array
nums
and an integerk
.A subarray is called equal if all of its elements are equal. Note that the empty subarray is an equal subarray.
Return the length of the longest possible equal subarray after deleting at most
k
elements fromnums
.A subarray is a contiguous, possibly empty sequence of elements within an array.
c++
1 | class Solution { |