input: 
  def build_dictionary(samples):
      dictionary = {}
      for sample in samples:
          key, value = sample.split("->")
          dictionary[key] = value
      return dictionary
  
  # Test cases:
  samples = ["apple->red", "banana->yellow", "cherry->red"]
  print(build_dictionary(samples))  # Output: {'apple': 'red', 'banana': 'yellow', 'cherry': 'red'}
  
output:     for sample in samples:
          key, value = sample.split("->")
          dictionary[key] = value
      return dictionary