def delete_node(head, key):
  #TODO: Write - Your - Code
  if not head:
    return head
  dummy = LinkedListNode(-1)
  dummy.next = head
  prev = dummy
  node = dummy.next
  while node:
    if node.data != key:
      prev.next = node
      prev = prev.next
    node = node.next
  prev.next = None
  return dummy.next

c7be76daebe0cab9beb62924091e1adcc3523c27
<mask token>

def delete_node(head, key):
    if not head:
        return head
    dummy = LinkedListNode(-1)
    dummy.next = head
    prev = dummy
    node = dummy.next
    while node:
        if node.data != key:
            prev.next = node
            prev = prev.next
        node = node.next
    prev.next = None
    return dummy.next

def delete_node(head, key):
  #TODO: Write - Your - Code
  if not head:
    return head
  dummy = LinkedListNode(-1)
  dummy.next = head
  prev = dummy
  node = dummy.next
  while node:
    if node.data != key:
      prev.next = node
      prev = prev.next
    node = node.next
  prev.next = None
  return dummy.next
