input: Write a function to remove all duplicates from a linked list in Python. The function should take a list of nodes as input and return a linked list with all unique elements in the same order they first appeared. If the input list is empty, the function should return an empty linked list.
  assert remove_duplicates([7, 14, 28, 28, 28, 35, 49])==LinkedList([7, 14, 28, 35, 49])
  assert remove_duplicates([1, 1, 1, 1])==LinkedList([1])
  assert remove_duplicates([35, 28, 14, 7, 7, 14, 28, 35])==LinkedList([35, 28, 14, 7])
  assert remove_duplicates([])==LinkedList([])
  assert remove_duplicates([49])==LinkedList([49])
output: def remove_duplicates(nodes):
      if not nodes:
          return LinkedList([])
      seen = set()
      result = LinkedList()
      for node in nodes:
          if node not in seen:
              seen.add(node)
              result.append(node)
      return result