Solution for finding two numbers in an array that add up to a given value