Find two numbers from an array that sum to a target number
cubui.com
cubui.com
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.