input: Write a function to create a dictionary from a list of string samples where each sample is in the format "key->value". The function should return the constructed dictionary.
  assert build_dictionary(["apple->red", "banana->yellow", "cherry->red"])=={"apple": "red", "banana": "yellow", "cherry": "red"}
  assert build_dictionary([])=={}
  assert build_dictionary(["grape->purple"])=={"grape": "purple"}
  assert build_dictionary(["book->blue", "pen->black"])=={"book": "blue", "pen": "black"}
  assert build_dictionary(["car->yellow", "bus->red", "truck->blue"])=={"car": "yellow", "bus": "red", "truck": "blue"}
output: def build_dictionary(samples):
      result = {}
      for sample in samples:
          key, value = sample.split('->')
          result[key] = value
      return result