Find Unique Values
There are n developers working at Amazon where the ith developer has the experience points experience[i]. The company decided to pair the developers by iteratively pairing the developers with the highest and lowest remaining experience points for a hackathon. The combined experience of a pair is the average of the experience points of the two developers. Find the number of unique values among the combined experience of the pairs formed.
Complete the function findUniqueValues in the editor below.
findUniqueValues has the following parameter:
int experience[n]: the experience points for each developer
Returns
int: the number of unique values among the combined experience points of the pairs formed
1Example 1
n = 6 developers. The pairs formed are (1, 6), (1, 5), and (4, 3) making their experience points 3.5, 3, and 3.5 respectively. There are 2 distinct values, 3 and 3.5, so return 2 as the answer.2Example 2
3Example 3
Constraints
Limits and guarantees your solution can rely on.