input: Write a function to build a dictionary from a list of string samples where each sample is in the format "key->value". The function should return a dictionary mapping each key to its corresponding value. If the 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(["dog->brown", "cat->black"])=={'dog': 'brown', 'cat': 'black'}
  assert build_dictionary([])=={}
  assert build_dictionary(["one->1", "two->2", "three->3"])=={'one': '1', 'two': '2', 'three': '3'}
output: def build_dictionary(samples):
      result = {}
      for sample in samples:
          key, value = sample.split('->')
          result[key] = value
      return result