Company: JPMorgan Chase
Difficulty: medium
Team Efficiency Calculation Problem Description A coding competition requires participants to be grouped into teams of exactly two members each, such that the sum of their skills is the same for all teams. The efficiency of a team is defined as the product of the skills of its members. For example, if a team has skills [2, 3], their efficiency is 2 * 3 = 6. Calculate the sum of the efficiencies of all the teams. If it is not possible to form the required teams under the given conditions, return -1. Notes: All participants must be assigned to a team. The answer is always unique. Function Description: Complete the function getTotalEfficiency in the editor with the following parameters: int skill[n] : the skills of each candidate Returns: long_int : the sum of the efficiencies if it is possible to form the teams, or -1 otherwise. Examples Example 1: Consider the skills of the candidates are skill = [1, 2, 3, 2] . They can be paired as [1, 3] , [2, 2] . The sum of skills for each team is t