Junior — Senior
Determine the first suitable pair of numbers with a given sum
livecode
Task condition
Create a function that takes an array of numbers and a required sum, which searches for the first pair of elements that give this sum and outputs them.
Examples Input: [8,5,3,5,6], 12 Output: [8, 4]
Input: [1,18,20,7,1], 2 Output: [1, 1]