Conversation
Maya
Walk me through your approach before you write anything.
You
A hash map of the numbers I have seen, so each lookup is constant time.
Maya
Look at line 5. When the match is found, what do you return?
1# two sum2def two_sum(nums, target):3 seen = {}4 for i, n in enumerate(nums):5 if target - n in seen:6 return [seen[target - n], i]