input: Write a function to delete a certain element from a linked list. The function should take a node as input and remove it from the linked list if it exists. If the node to be deleted is not in the linked list, the function should do nothing. If the node to be deleted is the head of the linked list, the function should update the head to the next node.
  
  assert deleteNode([1, 2, 3]) == [2, 3]
  assert deleteNode([1, 2, 3, 2]) == [1, 3, 2]
  assert deleteNode([1]) == []
  assert deleteNode([]) == []
output: def deleteNode(node):
      if node is None:
          return
      if node.next is not None:
          node.val = node.next.val
          node.next = node.next.next
      else:
          node = None