【leetcode❤python】237. Delete Node in a Linked List

#-*- coding: UTF-8 -*-
# Definition for singly-linked list.
# class ListNode(object):
#     def __init__(self, x):
#         self.val = x
#         self.next = None

class Solution(object):
   
    def deleteNode(self, node):
        if node.next==None or node ==None:return
        node.val=node.next.val
        node.next=node.next.next

原文地址:https://www.cnblogs.com/kwangeline/p/5953594.html