Two Sum — one pass with a hash map
For each number, the partner you need is target − num. Remember every number you've seen, so you can spot that partner the moment it's already there.
Try:
nums
seen so far  (value → index)