r/codinginterview • • Feb 05 '16

Amazon Programming Interview: check if an array of integers contains two elements that sum to a given x

http://www.davismol.net/2014/02/12/amazon-interview-check-if-an-array-of-integers-contains-two-elements-that-sum-to-a-given-x/
2 Upvotes

1 comment sorted by

2

u/aroduribe Apr 09 '16

Think this is known as two sum problem. If it is, you can use a hashmap for O(n) efficiency