Company: Salesforce_24may
Difficulty: medium
Special Subarrays Problem Description In Salesforce's annual hackathon, employees from a team are ranked based on their efficiency scores. These scores are represented as an array. The team lead wants to analyze subgroups of employees to identify groups with specific characteristics. 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 median.