Longest Continuous Subarray with Deletions

Asked at MathWorks · Coding Questions · Difficulty: Medium · Last asked Jul 15, 2026

Given an array containing the speeds of n players, you are allowed to remove up to k players to find the longest continuous subarray where all players have the same speed. The goal is to find such longest continuous subarray and return its length.

Loading the problem…