input: Write a function to build a dictionary from a list of string samples where each sample is in the format "key->value". The function should process each sample, split it into key and value, and then add it to the dictionary. If the sample list is empty, the function should return an empty 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 = []
  assert build_dictionary(samples) == {}
output: def build_dictionary(samples):
   dictionary = {}
   for sample in samples:
    key, value = sample.split("->")
    dictionary[key] = value
   return dictionary