Find the two elements that sum to a particular value
You have an array of ints A[]. How would you find the two elements that sum to a particular value S?
Example:
let
A[] = {1,2,-40,4,20,53}
S=13.
Expected Answer:
53 and -40
Just another WordPress weblog
Archive for the ‘Amazon’ Category.
You have an array of ints A[]. How would you find the two elements that sum to a particular value S?
Example:
let
A[] = {1,2,-40,4,20,53}
S=13.
Expected Answer:
53 and -40