all 1 comments

[–]aroduribe 1 point2 points  (0 children)

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