arr = [2,5,11,15],目标 =13
给出一个整数数组,返回两个数字的两个索引,使它们加起来达到一个特定的目标.输出两个整数.
Here is an implementation in Python that returns the indices of the two numbers such that they add up to the target.

def twoSum(arr, target):
    for i in range(len(arr)):
        for j in range(i+1, len(arr)):
            if arr[i]+arr[j]==target:
                return(i, j)

arr = [2, 5, 11, 15]
target = 13
print (twoSum(arr, target))

#Output: (0, 2)