Problem Statement | |||||||||||||
We wish to assign a score to the given array values. An empty array is assigned the score 0. Otherwise, we have one of the following cases:
| |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Notes | |||||||||||||
- | Given K numbers, their median is the ((K+1)/2)-th smallest of them, rounding down for even K, and indexing from 1. For example, the median of (1, 2, 2, 3, 5) is 2, and the median of (11, 13, 12, 14, 15) is 13. | ||||||||||||
Constraints | |||||||||||||
- | values will contain between 0 and 50 elements, inclusive. | ||||||||||||
- | Each element of values will be between -1000 and 1000, inclusive. | ||||||||||||
Examples | |||||||||||||
0) | |||||||||||||
| |||||||||||||
1) | |||||||||||||
| |||||||||||||
2) | |||||||||||||
| |||||||||||||
3) | |||||||||||||
| |||||||||||||
4) | |||||||||||||
|