input: Write a function to build a dictionary from string to string based on the given samples. Each sample is in the format "key->value". 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(["example->test", "sample->case"])=={'example': 'test', 'sample': 'case'}
  assert build_dictionary([])=={}
output: def build_dictionary(samples):
      result = {}
      for sample in samples:
          key, value = sample.split('->')
          result[key] = value
      return result