Company: Rippling_12oct
Difficulty: medium
Relay Race Team Formation Problem Description A sports club wants to send a team for a relay race. There are n racers standing in a line, indexed from 0 to n-1 , and racer i has a speed of speed[i] units. The coach wants to send a contiguous segment of racers who all have the same speed , to ensure a smooth baton transfer. To make the team as large as possible, the coach may first remove at most k racers from the line. Removed racers can be anywhere in the line; they do not have to be next to each other. The remaining racers close the gaps and keep their original relative order. Given the array of racer speeds and the integer k , find the maximum possible number of racers in a contiguous segment with the same speed after removing at most k racers. Function Description Complete the function getMaxRacers in the editor. getMaxRacers has the following parameters: speed : an array of n integers, the speeds of the racers in line order k : an integer, the maximum number of racers that can be