
Find two numbers from an array that sum to a target number - cubui
http://cubui.com/development/javascript/find-two-numbers-array-sum-target-number/
======
Someone
_”The time complexity is O(n) because we iterate the array of numbers
containing n elements only once.”_

If only. That ignores the dictionary look ups.

Also, there’s the tiny problem that this code is buggy. It only works if, for
every number in the array, _target - number_ also is in the array. It doesn’t
even work for the example given in the problem description, returning _(9,0)_
as one of the answers.

I hope this was posted as a warning that not everything you google is correct
since, otherwise, this would not be interesting at all.

