Add up to make equal

This Question Was Asked By Google

There is a list of numbers and a number k given. You have to return whether any two numbers from the list add up to make it equal to k.

Write a function solve that have the following parameter(s):
1.) arr = an array of integer
2.) k = integer

Example
Input:
[10, 15, 3, 7]
k = 17
Output:
The function will return,
10, 7

Explanation
After adding integers 7 and 10 from an array, it is equal to the value of k that is 17.

Constraints
• The size of the array will be greater than or equal to 1 and less than or equal to 800.
• An arr[i] will be greater than or equal to 0 and less than or equal to 1000.
• The value of k will be greater than or equal to 0 and less than or equal to 1000.