Problem Statement | |||||||||||||
A cat and a rabbit are playing a simple number guessing game.
The cat chose two different positive integers X and Y.
He then told the rabbit several numbers.
One of those numbers was X + Y and another was X - Y.
The others were simply made up.
The rabbit thinks the cat prefers large numbers. Given a int[] hints containing the numbers the cat told the rabbit, return the largest possible value of X * Y. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Constraints | |||||||||||||
- | hints will contain between 2 and 50 elements, inclusive. | ||||||||||||
- | Each element of hints will be between 1 and 100, inclusive. | ||||||||||||
- | All elements of hints will be distinct. | ||||||||||||
- | There will exist at least one pair of positive integers (X, Y) such that both X + Y and X - Y are elements of hints. | ||||||||||||
Examples | |||||||||||||
0) | |||||||||||||
| |||||||||||||
1) | |||||||||||||
| |||||||||||||
2) | |||||||||||||
| |||||||||||||
3) | |||||||||||||
| |||||||||||||
4) | |||||||||||||
|