I felt like doing an algorithm and found this problem on leetcode
Given an array of integers, find two numbers such that they add up to a specific target num
I would approach it this way:
Order your array from smaller to lower value
Loop over your array the way you have it but exit the loop early whenever
target <(numbers[i]+numbers[j])
Once you have the value of your two elements such that n[0] + n[1] = target, look back at the original array to find their index.