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