Maximum Possible Racers

Problem Overview

  • Determine the maximum length of a contiguous segment where all racers have equal speed after removing at most k racers.
  • Input: array speed of racer speeds and integer k; Output: integer maximum segment length.
  • Domain: HackerLand Sports Club forming a relay team needing uniform speed for smooth baton handoffs.
  • From Amazon interviews; a coding interview problem and common interview question.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: