Two Sum
Find indices with . If several pairs work, print the one with the smallest , and for that the smallest . Print -1 if no pair exists. Indices are 0-based.
Input
, then integers, then .
Output
i j or -1.
Constraints
. A hash map gives .
Sample 1
Input
4 2 7 11 15 9
Output
0 1
Sample 2
Input
3 1 2 3 7
Output
-1