12401 - Tsai DS 20191003 TwoSum   

Description

Given an array of integers, return the indices of the two array elements that add up to a specific target number.

You may assume that each input target number would have exactly one solution, and you may not use the same element twice.

Given nums = [2, 7, 11, 15], target = 9,
Because nums[0] + nums[1] = 2 + 7 = 9,

return [0, 1].

Input

The first line of input is the target number.

The second line of input is the length of the array.

The third line of input is the integer array.

Output

Please print out the two indices of the first combination which can add up to the specific target number.

If the answer does not exist, print out "No Solution".

There must be a new line at the end.

Sample Input  Download

Sample Output  Download

Tags

12401



Discuss