input: Write a function to build a dictionary from a list of samples where each sample is a string in the format "key->value". The function should return the constructed dictionary. If the given list of samples is empty, the function should return an empty dictionary.
  
  samples = ["apple->red", "banana->yellow", "cherry->red"]
  assert build_dictionary(samples) == {"apple": "red", "banana": "yellow", "cherry": "red"}
  assert build_dictionary([]) == {}
output: def build_dictionary(samples):
      result = {}
      for sample in samples:
          key, value = sample.split('->')
          result[key] = value
      return result