链表相关算法(python)

链表结构定义

class ListNode(object):

    def __init__(self, val, next):
        self.val = val
        s...