Company: Salesforce_24may
Difficulty: medium
Annual Salesforce Hackathon 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. Given: n employees in a team standing in a line, An array efficiency representing each employee's efficiency and An integer k (1 ≤ k ≤ n ), representing the reference employee in the array. 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)/2 th element of the array 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 = 4 th element is 2. Function Description Complete the function getSpecialSubarrays in the editor bel