leetcode 142. 环形链表 II (python3)

142. 环形链表 II 给定一个链表,返回链表开始入环的第一个节点。 若是链表无环,则返回 null。python 相遇以后,fast 和slow都用一倍速跑,相遇的地方即是起点 web # Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # self.nex
相关文章
相关标签/搜索