Company: Salesforce_24may
Difficulty: medium
Special Subarrays Problem Description During an internal hackathon at a software company, everyone on a team gets assigned an efficiency score, and these scores are stored in an array. The team's manager wants to study contiguous stretches of employees to spot groups sharing a certain trait. Find the number of subarrays of odd lengths with a median equal to efficiency[k]. Note: A subarray is a sequence of consecutive elements of the array. The median of an array of odd length, say n, is the (n+1)/2th element of the array if sorted in non-decreasing order. For example, the median of [2, 5, 4, 1, 1, 6] of length 7 is 2, since upon sorting, the array becomes [1, 1, 2, 4, 5, 6] and the (7+1)/2 = 4th element is 2. Complete the function getSpecialSubarrays in the editor below. getSpecialSubarrays has the following parameters: int efficiency[n] : efficiencies of people int k : the index of the required median value Returns: long : the number of odd-length subarrays where efficiency[k] is the