input: Write a python function to find two indices in a list that add up to a given target.
  assert two_sum([2, 7, 11, 15], 9) == [0, 1]
  assert two_sum([3, 2, 4], 6) == [1, 2]
  assert two_sum([3, 3], 6) == [0, 1]
output: def two_sum(nums, target):
      num_to_index = {}
      for i, num in enumerate(nums):
          complement = target - num
          if complement in num_to_index:
              return [num_to_index[complement], i]
          num_to_index[num] = i