Processing math: 100%

2SUM solved by 1415

Feb. 21, 2014, 4:23 p.m. by Rosalind Team

Topics: Sorting

Problem

Given: A positive integer k20, a positive integer n104, and k arrays of size n containing integers from 105 to 105.

Return: For each array A[1..n], output two different indices 1p<qn such that A[p]=A[q] if exist, and "-1" otherwise.

Sample Dataset

4 5
2 -3 4 10 5
8 2 4 -2 -8
-5 2 3 2 -4
5 4 -5 6 8

Sample Output

-1
2 4
-1
1 3

Please login to solve this problem.

Welcome to Rosalind!

Rosalind is a platform for learning bioinformatics through problem solving.
Please login with Google/Twitter/Facebook or register a new account.