Problem Statement | |||||||||||||
You are the coordinator of a contest, and you have been presented with the final scores of all the contestants. It is now your job to determine the quality of the contest. To do this, you will compute the average score after eliminating the k highest scoring contestants and the k lowest scoring contestants. k is a non-negative integer (it can be 0), and you will choose a value for k that yields the maximum average score. Return a double representing this maximum average score. You are not allowed to eliminate all the scores. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Notes | |||||||||||||
- | The returned value must be accurate to 1e-9 relative or absolute. | ||||||||||||
Constraints | |||||||||||||
- | scores will contain between 1 and 50 elements, inclusive. | ||||||||||||
- | Each element of scores will be between 1 and 1000, inclusive. | ||||||||||||
Examples | |||||||||||||
0) | |||||||||||||
| |||||||||||||
1) | |||||||||||||
| |||||||||||||
2) | |||||||||||||
| |||||||||||||
3) | |||||||||||||
| |||||||||||||
4) | |||||||||||||
|