Given a specific number (let's call it n
) and an array of numbers (let's call it numbers
)
write some code that returns a Boolean
, indicating if there is a pair of numbers in numbers
that together add up to n.
e.g.: n = 12, numbers = [1,2,3,4,5,6,7,8,9] -> true
(because 5 + 7 == 12)
e.g.2.: n = 20, numbers = [1,2,3,4,5,6] -> false