input: Write a function to create a dictionary from a list of string samples where each sample is a key-value pair separated by "->". The function should iterate through each sample, split it into a key and a value, and then add it to the dictionary. Finally, the function should return the built 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 = ["cat->meow", "dog->bark"]
  assert build_dictionary(samples) == {'cat': 'meow', 'dog': 'bark'}
  
  samples = ["car->blue"]
  assert build_dictionary(samples) == {'car': 'blue'}
  
  samples = []
  assert build_dictionary(samples) == {}
output: def build_dictionary(samples):
      dictionary = {}
      for sample in samples:
          key, value = sample.split("->")
          dictionary[key] = value
      return dictionary