Tap here to switch tabs
Problem
Submissions

Problem: Find the Longest Equal Subarray

med
30 min
Try to solve the Find the Longest Equal Subarray problem.

Statement

You are given an integer array nums and an integer k.

An equal subarray is defined as a contiguous sequence of elements within an array where every element is identical.

You may delete at most k elements from nums. Return the length of the longest possible equal subarray after performing these deletions.

Constraints:

  • 1≤1 \leq nums.length ≤105\leq 10^5

  • 1≤1 \leq nums[i] ≤\leq nums.length

  • 0≤0 \leq k ≤\leq nums.length

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Find the Longest Equal Subarray

med
30 min
Try to solve the Find the Longest Equal Subarray problem.

Statement

You are given an integer array nums and an integer k.

An equal subarray is defined as a contiguous sequence of elements within an array where every element is identical.

You may delete at most k elements from nums. Return the length of the longest possible equal subarray after performing these deletions.

Constraints:

  • 1≤1 \leq nums.length ≤105\leq 10^5

  • 1≤1 \leq nums[i] ≤\leq nums.length

  • 0≤0 \leq k ≤\leq nums.length