Second Largest
Print the second largest distinct value, or -1 if all values are equal.
Input
, then integers.
Output
The second largest distinct value.
Constraints
,
Sample 1
Input
4 3 7 7 2
Output
3
Sample 2
Input
2 4 4
Output
-1
Print the second largest distinct value, or -1 if all values are equal.
, then integers.
The second largest distinct value.
,
Input
4 3 7 7 2
Output
3
Input
2 4 4
Output
-1