/**
* Definition for singly-linked list.
* type ListNode struct {
* Val int
* Next *ListNode
* }
*/
func deleteNode(node *ListNode) {
node.Val = node.Next.Val
node.Next = node.Next.Next
}
/**
* Definition for singly-linked list.
* type ListNode struct {
* Val int
* Next *ListNode
* }
*/
func deleteNode(node *ListNode) {
if node == nil {
return
}
runner := node
for runner.Next.Next != nil {
runner.Val = runner.Next.Val
runner = runner.Next
}
runner.Val = runner.Next.Val
runner.Next = nil
}