Program - Given an array of integers, return indices of the two numbers such that they add up to a specific target.


Topic: Program - Given an array of integers, return indices of the two numbers such that they add up to a specific target.

Solution

input_array = [2, 7, 11, 15]
target = 26
result = []
for i, num in enumerate(input_array):
    for j in range(i+1, len(input_array)):
        print(i,j)



List all Python Programs