input: Write a python function to find pairs of indices whose corresponding values sum to a given target.
  assert find_pairs_with_sum([1, 2, 3, 4, 5], 5) == [0, 3, 1, 2]
  assert find_pairs_with_sum([10, 20, 10, 40, 50, 60, 70], 50) == [0, 3, 1, 2]
  assert find_pairs_with_sum([1, 1, 1, 1], 2) == [0, 1, 0, 2, 0, 3, 1, 2, 1, 3, 2, 3]
output: def find_pairs_with_sum(arr, target):
      pairs = []
      for i in range(len(arr)):
          for j in range(i + 1, len(arr)):
              if arr[i] + arr[j] == target:
                  pairs.extend([i, j])
      return pairs