Company: Rippling_12oct
Difficulty: medium
Relay Race Team Formation Problem Description HackerLand Sports Club wants to send a team for a relay race. There are n racers indexed from 0 to n-1, each with a speed of speed[i] units. For a successful baton transfer, two adjacent racers must have the same speed to ensure smooth baton transfer. To maximize the team size, the coach may remove at most k racers from the group. Given the array of racer speeds speed[] and an 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 with the following parameters: int speed[] : the speeds of the racers int k : the maximum number of racers that can be removed Returns int : the maximum number of racers that can be sent after removing at most k racers Examples Example 1: Input: speed = [1, 4, 4, 2, 4] k = 2 Output: 3 Explanation: The optimal strategy is to remove the two racers with speed 2, resulting i