【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

posted @ 2016-10-12 17:02  火金队长  阅读(154)  评论(0编辑  收藏  举报