Given a list of numbers and a target, find two numbers that add up to the target. Return their indices. For [2, 7, 11, 15] with target , return [0, 1] because .
The brute force approach checks all pairs. But with a dictionary, you can solve this in one pass. Think: what should you store in the dictionary?