input: Write a function to build a dictionary from string to string based on the given sample data where each sample contains a key and a value separated by "->". 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(["car->blue", "bike->green", "truck->black"])=={'car': 'blue', 'bike': 'green', 'truck': 'black'}
  assert build_dictionary([])=={}
  assert build_dictionary(["1->one", "2->two", "3->three"])=={'1': 'one', '2': 'two', '3': 'three'}
output: def build_dictionary(samples):
      result = {}
      for sample in samples:
          key, value = sample.split("->")
          result[key] = value
      return result