First line: n and target. Second line: n integers. Print the (0-based) indices of the two numbers that add up to target, smaller index first. Exactly one solution exists.
4 9 2 7 11 15
0 1
2 ≤ n ≤ 10^5-10^9 ≤ values ≤ 10^9Run your code to see results
Press Ctrl ↵ to run or Ctrl ⇧ ↵ to submit.