input: Write a function to create a dictionary from string pairs represented as "key->value" in the given list of samples. Each sample is a string where the key and value are separated by "->". If the input list is empty, return an empty dictionary.
  
  def build_dictionary(samples):
   dictionary = {}
   for sample in samples:
    key, value = sample.split("->")
    dictionary[key] = value
   return dictionary
  
  samples1 = ["apple->red", "banana->yellow", "cherry->red"]
  assert build_dictionary(samples1) == {"apple": "red", "banana": "yellow", "cherry": "red"}
  
  samples2 = ["dog->brown", "cat->black"]
  assert build_dictionary(samples2) == {"dog": "brown", "cat": "black"}
  
  samples3 = []
  assert build_dictionary(samples3) == {}
output: def build_dictionary(samples):
      dictionary = {}
      for sample in samples:
          key, value = sample.split("->")
          dictionary[key] = value
      return dictionary