Problem Statement | |||||||||||||
Your are given a int[] numbers. Your task is to split these numbers into exactly n groups such that the difference between the highest average of any group and the lowest average of any group is minimized. Each element of numbers must belong to exactly one of the n groups. Return this minimal difference. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Notes | |||||||||||||
- | The return value must be within 1e-9 absolute or relative error of the actual result. | ||||||||||||
Constraints | |||||||||||||
- | numbers will have between 1 and 9 elements inclusive. | ||||||||||||
- | Each element in numbers will be between 1 and 1000 inclusive. | ||||||||||||
- | n will be between 1 and the number of elements in numbers inclusive. | ||||||||||||
Examples | |||||||||||||
0) | |||||||||||||
| |||||||||||||
1) | |||||||||||||
| |||||||||||||
2) | |||||||||||||
| |||||||||||||
3) | |||||||||||||
|