You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
上面的我搞错了,正确应该是这样吧。。
def getloopmeet(head):
fast = head.next.next
slow = head.next
while fast != slow:
if fast == None or slow == None:
return None
fast = fast.next.next
slow = slow.next
fast = head
while fast != slow:
fast = fast.next
slow = slow.next
return fast
Activity
GitMsw commentedon Apr 21, 2020
上面的我搞错了,正确应该是这样吧。。
def getloopmeet(head):
fast = head.next.next
slow = head.next
while fast != slow:
if fast == None or slow == None:
return None
fast = fast.next.next
slow = slow.next
fast = head
while fast != slow:
fast = fast.next
slow = slow.next
return fast