一、题目
两数之和 - 力扣(LeetCode) 【可参考该题理解原题】
原题链接https://www.codewars.com/kata/52c31f8e6605bcc646000082/train/c
Write a function that takes an array of numbers (integers for the tests) and a target number. It should find two different items in the array that, when added together, give the target value. The indices of these items should then be returned in a tuple / list (depending on your language) like so: (index1, index2)
.
For the purposes of this kata, some tests may have multiple answers; any valid solutions will be accepted.
The input will