Get Exp.
Note --> Feel free to check the source image below for the original problem statement :)
At a bustling tech company, there are n developers, each with their own set of experience points. The company is gearing up for an exciting hackathon and has come up with a unique way to form pairs of developers for the event. Their plan is to create pairs by matching the developer with the highest experience points with the one with the lowest experience points, and then move inward from both ends.
As the developers are paired, the company is interested in analyzing the combined experience of each pair. The combined experience of a pair is calculated as the average of the experience points of the two developers.
Your challenge is to determine how many unique values there are among these combined experience points.
In simpler terms, given the list of experience points for all developers, you need to find out how many distinct average values result from pairing the highest and lowest remaining experience points iteratively.
1Example 1
2Example 2
3Example 3
Constraints
Limits and guarantees your solution can rely on.
2 ≤ n ≤ 10^50 ≤ exp[i] ≤ 10^9n is an even number