All challenges
easyarrays 10 XP per passing test

Two Sum

Problem

Given an array of integers and an integer target, find two elements in the array that add up to the target. Return the indices of these two numbers. The indices should be 1-based. If no such pair exists, return -1.
(run your code to see output)
Advertisement
Sponsored