2 points · by cubui · 7y ago · 1 comment
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.