input: Write a function to build a dictionary from a list of string pairs where each pair is separated by an arrow. The function should split each pair into a key and a value and add them to the dictionary. Return the dictionary.
  def build_dictionary(samples):
   dictionary = {}
   for sample in samples:
    key, value = sample.split("->")
    dictionary[key] = value
   return dictionary
  
  samples = ["apple->red", "banana->yellow", "cherry->red"]
  assert build_dictionary(samples) == {'apple': 'red', 'banana': 'yellow', 'cherry': 'red'}
  samples = ["grape->purple"]
  assert build_dictionary(samples) == {'grape': 'purple'}
  samples = []
  assert build_dictionary(samples) == {}
output: def build_dictionary(samples):
   dictionary = {}
   for sample in samples:
    key, value = sample.split("->")
    dictionary[key] = value
   return dictionary