input: Write a function to list the contents of a specified directory. If the directory path is not provided, list the contents of the current directory. The function should return a list of file and directory names without any additional information.
  assert list_directory_contents("path/to/directory")==["file1.txt", "file2.txt", "dir1", "dir2"]
  assert list_directory_contents("non/existent/path")==[]
  assert list_directory_contents()==["file1.txt", "file2.txt", "dir1", "dir2"]
  assert list_directory_contents("a/directory/with/one/file")==["file1.txt"]
  assert list_directory_contents("a/directory/with/no/files")==[]
output: import os
  
  def list_directory_contents(path=None):
      if path is None:
          path = os.getcwd()
      if not os.path.exists(path):
          return []
      return [name for name in os.listdir(path) if os.path.isfile(os.path.join(path, name)) or os.path.isdir(os.path.join(path, name))]