Company: Servicenow_8june
Difficulty: medium
Minimum Task Cost Problem Description A group of workers gathered to complete a task. Each worker has an efficiency rating. They will be grouped in pairs so an even number of workers are required. The cost of a pair is the absolute difference of the efficiencies assigned to the workers. The cost of the task is the sum of the costs of all pairs formed. There are an odd number of workers to choose from, so one worker will not be paired. Select the worker to exclude so the task's cost is minimized. Given n workers and efficiency for each worker, find a configuration of the workers such that the cost of the task is the minimum possible. Return the minimum cost as the answer. Complete the function findMinCost in the editor below. findMinCost has the following parameter(s): int efficiency[n] : the efficiency of each worker Returns: int : the minimum possible cost Examples Example 1: Input: efficiency = [4, 2, 8, 1, 9] Output: 2 Explanation: Using 1-based indexing, if worker 1 is excluded and