input: Write a function to find and return the longest string in a given list. The function should take in a list of strings and return the longest one. If the list is empty, the function should return an empty string.
  assert longest_string(['foo', 'test', 'longstring', 'bar']) == 'longstring'
  assert longest_string(['a', 'bb', 'ccc', 'dddd']) == 'dddd'
  assert longest_string(['apple', 'banana', 'cherry', 'date']) == 'banana'
  assert longest_string([]) == ''
  assert longest_string(['hello', 'world']) == 'hello'
output: def longest_string(strings):
      if not strings:
          return ''
      return max(strings, key=len)